6dd5d1abc9860e0b6a23c153f1187732e54ccf90
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2006-06-28  Timothy Hatcher  <timothy@apple.com>
2
3         Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
4
5         * JavaScriptCore.xcodeproj/project.pbxproj:
6
7 2006-06-27  Timothy Hatcher  <timothy@apple.com>
8
9         Reviewed by Tim O.
10
11         <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
12
13         Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
14         Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
15         Lots of code style cleanup.
16
17         * JavaScriptCore.xcodeproj/project.pbxproj:
18         * bindings/objc/objc_class.h:
19         * bindings/objc/objc_class.mm:
20         (KJS::Bindings::ObjcClass::~ObjcClass):
21         (KJS::Bindings::_createClassesByIsAIfNecessary):
22         (KJS::Bindings::ObjcClass::classForIsA):
23         (KJS::Bindings::ObjcClass::name):
24         (KJS::Bindings::ObjcClass::methodsNamed):
25         (KJS::Bindings::ObjcClass::fieldNamed):
26         (KJS::Bindings::ObjcClass::fallbackObject):
27         * bindings/objc/objc_header.h:
28         * bindings/objc/objc_instance.h:
29         * bindings/objc/objc_instance.mm:
30         (ObjcInstance::ObjcInstance):
31         (ObjcInstance::~ObjcInstance):
32         (ObjcInstance::operator=):
33         (ObjcInstance::begin):
34         (ObjcInstance::end):
35         (ObjcInstance::getClass):
36         (ObjcInstance::invokeMethod):
37         (ObjcInstance::invokeDefaultMethod):
38         (ObjcInstance::setValueOfField):
39         (ObjcInstance::supportsSetValueOfUndefinedField):
40         (ObjcInstance::setValueOfUndefinedField):
41         (ObjcInstance::getValueOfField):
42         (ObjcInstance::getValueOfUndefinedField):
43         (ObjcInstance::defaultValue):
44         (ObjcInstance::stringValue):
45         (ObjcInstance::numberValue):
46         (ObjcInstance::booleanValue):
47         (ObjcInstance::valueOf):
48         * bindings/objc/objc_runtime.h:
49         * bindings/objc/objc_runtime.mm:
50         (ObjcMethod::ObjcMethod):
51         (ObjcMethod::name):
52         (ObjcMethod::getMethodSignature):
53         (ObjcMethod::setJavaScriptName):
54         (ObjcField::name):
55         (ObjcField::type):
56         (ObjcField::valueFromInstance):
57         (convertValueToObjcObject):
58         (ObjcField::setValueToInstance):
59         (ObjcArray::operator=):
60         (ObjcArray::setValueAt):
61         (ObjcArray::valueAt):
62         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
63         (ObjcFallbackObjectImp::callAsFunction):
64         (ObjcFallbackObjectImp::defaultValue):
65
66 2006-06-28  Anders Carlsson  <acarlsson@apple.com>
67
68         Reviewed by Geoff.
69
70         http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
71         REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
72
73         * bindings/jni/jni_objc.mm:
74         (KJS::Bindings::dispatchJNICall):
75         Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
76         containing the applet (which is what we used to do).
77
78 2006-06-27  Timothy Hatcher  <timothy@apple.com>
79
80         Reviewed by Darin.
81
82         <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
83
84         * JavaScriptCore.exp: Added.
85         * JavaScriptCore.xcodeproj/project.pbxproj:
86
87 2006-06-25  Geoffrey Garen  <ggaren@apple.com>
88
89         Reviewed by Adele.
90         
91         - Added JSConstructorMake to match JSFunctionMake, along with test code.
92         
93         [ I checked in the ChangeLog before without the actual files. ]
94
95         * API/JSObjectRef.cpp:
96         (JSConstructorMake):
97         * API/JSObjectRef.h:
98         * API/testapi.c:
99         (myConstructor_callAsConstructor):
100         (main):
101         * API/testapi.js:
102         * ChangeLog:
103         * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
104         target -- this was an oversight in my earlier check-in.
105
106 2006-06-25  Timothy Hatcher  <timothy@apple.com>
107
108         Reviewed by Darin.
109
110         Bug 9574: Drosera should show inline scripts within the original HTML
111         http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
112
113         Pass the starting line number and error message to the debugger.
114
115         * kjs/debugger.cpp:
116         (Debugger::sourceParsed):
117         * kjs/debugger.h:
118         * kjs/function.cpp:
119         (KJS::GlobalFuncImp::callAsFunction):
120         * kjs/function_object.cpp:
121         (FunctionObjectImp::construct):
122         * kjs/interpreter.cpp:
123         (KJS::Interpreter::evaluate):
124
125 2006-06-24  Alexey Proskuryakov  <ap@nypop.com>
126
127         Rubber-stamped by Eric.
128
129         Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
130         a symlink was created inside the source directory on second build).
131
132         * JavaScriptCore.xcodeproj/project.pbxproj:
133
134 2006-06-24  David Kilzer  <ddkilzer@kilzer.net>
135
136         Reviewed by Timothy.
137
138         * Info.plist: Fixed copyright to include 2003-2006.
139
140 2006-06-24  Alexey Proskuryakov  <ap@nypop.com>
141
142         Reviewed by Darin.
143
144         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
145         WebKit will not build when Space exists in path
146
147         * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to 
148         avoid passing paths with spaces to make.
149
150 2006-06-23  Timothy Hatcher  <timothy@apple.com>
151
152         Reviewed by Darin.
153
154         Adding more operator[] overloads for long and short types.
155
156         * wtf/Vector.h:
157         (WTF::Vector::operator[]):
158
159 === JavaScriptCore-521.13 ===
160
161 2006-06-22  Alexey Proskuryakov  <ap@nypop.com>
162
163         Build fix.
164
165         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
166         Another case error preventing build
167
168         * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
169         
170 2006-06-22  David Kilzer  <ddkilzer@kilzer.net>
171
172         Build fix.
173
174         http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
175         Another case error preventing build
176
177         * API/APICast.h: Changed "UString.h" to "ustring.h".
178
179 2006-06-21  Geoffrey Garen  <ggaren@apple.com>
180
181         Fixed release build, fixed accidental infinite recursion due to
182         last minute global replace gone awry.
183         
184         * API/APICast.h:
185         (toRef):
186         * API/testapi.c:
187         (assertEqualsAsBoolean):
188         (assertEqualsAsNumber):
189         (assertEqualsAsUTF8String):
190         (assertEqualsAsCharactersPtr):
191         * JavaScriptCore.xcodeproj/project.pbxproj:
192
193 2006-06-21  Geoffrey Garen  <ggaren@apple.com>
194
195         Reviewed by Anders.
196         
197         - First cut at C API to JavaScript. Includes a unit test, 'testapi.c', 
198         and the outline of a test app, 'minidom.c'.
199         
200         Includes one change to JSC internals: Rename propList to getPropertyList and have it
201         take its target property list by reference so that subclasses can
202         add properties to the list before calling through to their superclasses.
203         
204         Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
205         to give a shout-out to that.
206         
207         * API/APICast.h: Added.
208         (toJS):
209         (toRef):
210         * API/JSBase.h: Added.
211         * API/JSCallbackObject.cpp: Added.
212         (KJS::):
213         (KJS::JSCallbackObject::JSCallbackObject):
214         (KJS::JSCallbackObject::~JSCallbackObject):
215         (KJS::JSCallbackObject::className):
216         (KJS::JSCallbackObject::getOwnPropertySlot):
217         (KJS::JSCallbackObject::put):
218         (KJS::JSCallbackObject::deleteProperty):
219         (KJS::JSCallbackObject::implementsConstruct):
220         (KJS::JSCallbackObject::construct):
221         (KJS::JSCallbackObject::implementsCall):
222         (KJS::JSCallbackObject::callAsFunction):
223         (KJS::JSCallbackObject::getPropertyList):
224         (KJS::JSCallbackObject::toBoolean):
225         (KJS::JSCallbackObject::toNumber):
226         (KJS::JSCallbackObject::toString):
227         (KJS::JSCallbackObject::setPrivate):
228         (KJS::JSCallbackObject::getPrivate):
229         (KJS::JSCallbackObject::cachedValueGetter):
230         (KJS::JSCallbackObject::callbackGetter):
231         * API/JSCallbackObject.h: Added.
232         (KJS::JSCallbackObject::classInfo):
233         * API/JSCharBufferRef.cpp: Added.
234         (JSStringMake):
235         (JSCharBufferCreate):
236         (JSCharBufferCreateUTF8):
237         (JSCharBufferRetain):
238         (JSCharBufferRelease):
239         (JSValueCopyStringValue):
240         (JSCharBufferGetLength):
241         (JSCharBufferGetCharactersPtr):
242         (JSCharBufferGetCharacters):
243         (JSCharBufferGetMaxLengthUTF8):
244         (JSCharBufferGetCharactersUTF8):
245         (JSCharBufferIsEqual):
246         (JSCharBufferIsEqualUTF8):
247         (JSCharBufferCreateWithCFString):
248         (CFStringCreateWithJSCharBuffer):
249         * API/JSCharBufferRef.h: Added.
250         * API/JSContextRef.cpp: Added.
251         (JSContextCreate):
252         (JSContextDestroy):
253         (JSContextGetGlobalObject):
254         (JSEvaluate):
255         (JSCheckSyntax):
256         (JSContextHasException):
257         (JSContextGetException):
258         (JSContextClearException):
259         (JSContextSetException):
260         * API/JSContextRef.h: Added.
261         * API/JSObjectRef.cpp: Added.
262         (JSValueToObject):
263         (JSObjectMake):
264         (JSFunctionMake):
265         (JSObjectGetDescription):
266         (JSObjectGetPrototype):
267         (JSObjectSetPrototype):
268         (JSObjectHasProperty):
269         (JSObjectGetProperty):
270         (JSObjectSetProperty):
271         (JSObjectDeleteProperty):
272         (JSObjectGetPrivate):
273         (JSObjectSetPrivate):
274         (JSObjectIsFunction):
275         (JSObjectCallAsFunction):
276         (JSObjectIsConstructor):
277         (JSObjectCallAsConstructor):
278         (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
279         (JSObjectCreatePropertyEnumerator):
280         (JSPropertyEnumeratorGetNext):
281         (JSPropertyEnumeratorRetain):
282         (JSPropertyEnumeratorRelease):
283         (JSPropertyListAdd):
284         * API/JSObjectRef.h: Added.
285         * API/JSValueRef.cpp: Added.
286         (JSValueGetType):
287         (JSValueIsUndefined):
288         (JSValueIsNull):
289         (JSValueIsBoolean):
290         (JSValueIsNumber):
291         (JSValueIsString):
292         (JSValueIsObject):
293         (JSValueIsEqual):
294         (JSValueIsStrictEqual):
295         (JSUndefinedMake):
296         (JSNullMake):
297         (JSBooleanMake):
298         (JSNumberMake):
299         (JSValueToBoolean):
300         (JSValueToNumber):
301         (JSGCProtect):
302         (JSGCUnprotect):
303         (JSGCCollect):
304         * API/JSValueRef.h: Added.
305         * API/JavaScriptCore.h: Added.
306         * API/minidom.c: Added.
307         (main):
308         * API/minidom.html: Added.
309         * API/minidom.js: Added.
310         * API/testapi.c: Added.
311         (assertEqualsAsBoolean):
312         (assertEqualsAsNumber):
313         (assertEqualsAsUTF8String):
314         (assertEqualsAsCharactersPtr):
315         (assertEqualsAsCharacters):
316         (MyObject_initialize):
317         (MyObject_copyDescription):
318         (MyObject_hasProperty):
319         (MyObject_getProperty):
320         (MyObject_setProperty):
321         (MyObject_deleteProperty):
322         (MyObject_getPropertyList):
323         (MyObject_callAsFunction):
324         (MyObject_callAsConstructor):
325         (MyObject_convertToType):
326         (MyObject_finalize):
327         (print_callAsFunction):
328         (main):
329         (createStringWithContentsOfFile):
330         * API/testapi.js: Added.
331         * ChangeLog:
332         * JavaScriptCore.xcodeproj/project.pbxproj:
333         * bindings/npruntime_impl.h:
334         * kjs/array_instance.h:
335         * kjs/array_object.cpp:
336         (ArrayInstance::getPropertyList):
337         * kjs/interpreter.cpp:
338         (KJS::Interpreter::evaluate):
339         * kjs/nodes.cpp:
340         (ForInNode::execute):
341         * kjs/object.cpp:
342         (KJS::JSObject::put):
343         (KJS::JSObject::canPut):
344         (KJS::JSObject::deleteProperty):
345         (KJS::JSObject::propertyIsEnumerable):
346         (KJS::JSObject::getPropertyAttributes):
347         (KJS::JSObject::getPropertyList):
348         * kjs/object.h:
349         * kjs/property_map.cpp:
350         (KJS::PropertyMap::get):
351         * kjs/property_map.h:
352         * kjs/scope_chain.cpp:
353         (KJS::ScopeChain::print):
354         * kjs/string_object.cpp:
355         (StringInstance::getPropertyList):
356         * kjs/string_object.h:
357         * kjs/ustring.h:
358         (KJS::UString::Rep::ref):
359
360 2006-06-20  Timothy Hatcher  <timothy@apple.com>
361
362         Reviewed by Geoff.
363
364         Make sure we clear the exception before returning so
365         that future calls will not fail because of an earlier
366         exception state. Assert on entry that the WebScriptObject
367         is working with an ExecState that dose not have an exception. 
368         Document that evaluateWebScript and callWebScriptMethod return
369         WebUndefined when an exception is thrown.
370
371         * bindings/objc/WebScriptObject.h:
372         * bindings/objc/WebScriptObject.mm:
373         (-[WebScriptObject callWebScriptMethod:withArguments:]):
374         (-[WebScriptObject evaluateWebScript:]):
375         (-[WebScriptObject setValue:forKey:]):
376         (-[WebScriptObject valueForKey:]):
377         (-[WebScriptObject removeWebScriptKey:]):
378         (-[WebScriptObject webScriptValueAtIndex:]):
379         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
380
381 2006-06-19  Anders Carlsson  <acarlsson@apple.com>
382
383         Reviewed by John.
384
385         * kjs/interpreter.cpp:
386         (KJS::TimeoutChecker::pauseTimeoutCheck):
387         (KJS::TimeoutChecker::resumeTimeoutCheck):
388         Fix argument order in setitimer calls.
389
390 2006-06-18  Anders Carlsson  <acarlsson@apple.com>
391
392         Reviewed by Geoff.
393
394         * kjs/interpreter.cpp:
395         (KJS::TimeoutChecker::pauseTimeoutCheck):
396         Do nothing if the timeout check hasn't been started.
397         
398         (KJS::TimeoutChecker::resumeTimeoutCheck):
399         Do nothing if the timeout check hasn't been started.
400         Use the right signal handler when unblocking.
401         
402         (KJS::Interpreter::handleTimeout):
403         pause/resume the timeout check around the call to
404         shouldInterruptScript().
405         
406 2006-06-16  Ben Goodger <beng@google.com>
407         
408         Reviewed by Maciej
409
410         http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
411         Windows build breaks in interpreter.cpp 
412
413         * kjs/interpreter.cpp
414         (KJS::TimeoutChecker::pauseTimeoutCheck):
415         (KJS::TimeoutChecker::resumeTimeoutCheck):
416         Make sure to only assert equality with s_executingInterpreter when it 
417         is being used (i.e. when HAVE(SYS_TIME_H) == true)
418
419 2006-06-17  David Kilzer  <ddkilzer@kilzer.net>
420
421         Reviewed by darin.
422
423         http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
424         REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
425
426         * kjs/function.cpp:
427         (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
428         in case the WebFrame it was running in has since been destroyed.
429
430 2006-06-17  David Kilzer  <ddkilzer@kilzer.net>
431
432         Reviewed by ggaren.
433
434         http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
435         REGRESSION: Reproducible crash after closing window after viewing
436         css2.1/t0803-c5501-imrgn-t-00-b-ag.html
437
438         * kjs/debugger.cpp:
439         (Debugger::detach): Call setDebugger(0) for all interpreters removed from
440         the 'attached to a debugger' list.
441
442 2006-06-17  Anders Carlsson  <acarlsson@apple.com>
443
444         Reviewed by Maciej and Geoff.
445
446         http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
447         Provide some way to stop a JavaScript infinite loop
448         
449         * kjs/completion.h:
450         (KJS::):
451         Add Interrupted completion type.
452         
453         * kjs/function.cpp:
454         (KJS::FunctionImp::callAsFunction):
455         (KJS::GlobalFuncImp::callAsFunction):
456         Only set the exception on the new ExecState if the current one has had one.
457         
458         * kjs/interpreter.cpp:
459         (KJS::TimeoutChecker::startTimeoutCheck):
460         (KJS::TimeoutChecker::stopTimeoutCheck):
461         (KJS::TimeoutChecker::alarmHandler):
462         (KJS::TimeoutChecker::pauseTimeoutCheck):
463         (KJS::TimeoutChecker::resumeTimeoutCheck):
464         New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
465         period of time. This currently only works on Unix platforms where setitimer and signals are used.
466         
467         (KJS::Interpreter::Interpreter):
468         Initialize new member variables.
469         
470         (KJS::Interpreter::~Interpreter):
471         Destroy the timeout checker.
472         
473         (KJS::Interpreter::startTimeoutCheck):
474         (KJS::Interpreter::stopTimeoutCheck):
475         (KJS::Interpreter::pauseTimeoutCheck):
476         (KJS::Interpreter::resumeTimeoutCheck):
477         Call the timeout checker.
478         
479         (KJS::Interpreter::handleTimeout):
480         Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
481         
482         * kjs/interpreter.h:
483         (KJS::Interpreter::setTimeoutTime):
484         New function for setting the timeout time.
485         
486         (KJS::Interpreter::shouldInterruptScript):
487         New function. The idea is that this should be overridden by subclasses in order to for example
488         pop up a dialog asking the user if the script should be interrupted.
489         
490         (KJS::Interpreter::checkTimeout):
491         New function which checks the m_timedOut flag and calls handleTimeout if it's set.
492         
493         * kjs/nodes.cpp:
494         (DoWhileNode::execute):
495         (WhileNode::execute):
496         (ForNode::execute):
497         Call Interpreter::checkTimeout after each iteration of the loop.
498
499 2006-06-15  Timothy Hatcher  <timothy@apple.com>
500
501         Reviewed by Geoff and Darin.
502         
503         Prefer the DWARF debugging symbols format for use in Xcode 2.3.
504
505         * JavaScriptCore.xcodeproj/project.pbxproj:
506
507 2006-06-14  Geoffrey Garen  <ggaren@apple.com>
508
509         Reviewed by Beth.
510         
511         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
512         Someone broke ToT: cannot build
513
514         * JavaScriptCore.xcodeproj/project.pbxproj:
515         * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
516
517 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
518
519         build fix
520         
521         * bindings/objc/WebScriptObject.mm:
522         (+[WebScriptObject throwException:]): Restore assignment I accidentally
523         deleted in previous commit
524
525 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
526
527         Reviewed by TimO, Maciej.
528         
529         - Merged InterpreterImp code into Interpreter, which implements
530         all interpreter functionality now. This is part of my continuing quest
531         to create an external notion of JS "execution context" that is unified and simple --
532         something to replace the mix of Context, ContextImp, ExecState, Interpreter,
533         InterpreterImp, and JSRun.
534         
535         All tests pass. Leaks test has not regressed from its baseline ~207 leaks
536         with ~3460 leaked nodes.
537
538         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
539         * JavaScriptCore.xcodeproj/project.pbxproj:
540         * bindings/NP_jsobject.cpp:
541         * bindings/objc/WebScriptObject.mm:
542         (+[WebScriptObject throwException:]):
543         * bindings/runtime_root.cpp:
544         * bindings/runtime_root.h:
545         * kjs/Context.cpp:
546         (KJS::Context::Context):
547         * kjs/ExecState.cpp: Added.
548         (KJS::ExecState::lexicalInterpreter):
549         * kjs/ExecState.h: Added.
550         (KJS::ExecState::dynamicInterpreter):
551         * kjs/SavedBuiltins.h: Added.
552         * kjs/bool_object.cpp:
553         (BooleanPrototype::BooleanPrototype):
554         * kjs/collector.cpp:
555         (KJS::Collector::collect):
556         (KJS::Collector::numInterpreters):
557         * kjs/context.h:
558         * kjs/debugger.cpp:
559         (Debugger::attach):
560         (Debugger::detach):
561         * kjs/function.cpp:
562         (KJS::FunctionImp::callAsFunction):
563         (KJS::GlobalFuncImp::callAsFunction):
564         * kjs/function_object.cpp:
565         (FunctionObjectImp::construct):
566         * kjs/internal.cpp:
567         * kjs/internal.h:
568         * kjs/interpreter.cpp:
569         (KJS::interpreterMap):
570         (KJS::Interpreter::Interpreter):
571         (KJS::Interpreter::init):
572         (KJS::Interpreter::~Interpreter):
573         (KJS::Interpreter::globalObject):
574         (KJS::Interpreter::initGlobalObject):
575         (KJS::Interpreter::globalExec):
576         (KJS::Interpreter::checkSyntax):
577         (KJS::Interpreter::evaluate):
578         (KJS::Interpreter::builtinObject):
579         (KJS::Interpreter::builtinFunction):
580         (KJS::Interpreter::builtinArray):
581         (KJS::Interpreter::builtinBoolean):
582         (KJS::Interpreter::builtinString):
583         (KJS::Interpreter::builtinNumber):
584         (KJS::Interpreter::builtinDate):
585         (KJS::Interpreter::builtinRegExp):
586         (KJS::Interpreter::builtinError):
587         (KJS::Interpreter::builtinObjectPrototype):
588         (KJS::Interpreter::builtinFunctionPrototype):
589         (KJS::Interpreter::builtinArrayPrototype):
590         (KJS::Interpreter::builtinBooleanPrototype):
591         (KJS::Interpreter::builtinStringPrototype):
592         (KJS::Interpreter::builtinNumberPrototype):
593         (KJS::Interpreter::builtinDatePrototype):
594         (KJS::Interpreter::builtinRegExpPrototype):
595         (KJS::Interpreter::builtinErrorPrototype):
596         (KJS::Interpreter::builtinEvalError):
597         (KJS::Interpreter::builtinRangeError):
598         (KJS::Interpreter::builtinReferenceError):
599         (KJS::Interpreter::builtinSyntaxError):
600         (KJS::Interpreter::builtinTypeError):
601         (KJS::Interpreter::builtinURIError):
602         (KJS::Interpreter::builtinEvalErrorPrototype):
603         (KJS::Interpreter::builtinRangeErrorPrototype):
604         (KJS::Interpreter::builtinReferenceErrorPrototype):
605         (KJS::Interpreter::builtinSyntaxErrorPrototype):
606         (KJS::Interpreter::builtinTypeErrorPrototype):
607         (KJS::Interpreter::builtinURIErrorPrototype):
608         (KJS::Interpreter::mark):
609         (KJS::Interpreter::interpreterWithGlobalObject):
610         (KJS::Interpreter::saveBuiltins):
611         (KJS::Interpreter::restoreBuiltins):
612         * kjs/interpreter.h:
613         (KJS::Interpreter::setCompatMode):
614         (KJS::Interpreter::compatMode):
615         (KJS::Interpreter::firstInterpreter):
616         (KJS::Interpreter::nextInterpreter):
617         (KJS::Interpreter::prevInterpreter):
618         (KJS::Interpreter::debugger):
619         (KJS::Interpreter::setDebugger):
620         (KJS::Interpreter::setContext):
621         (KJS::Interpreter::context):
622         * kjs/nodes.cpp:
623         (StatementNode::hitStatement):
624         (RegExpNode::evaluate):
625         * kjs/protect.h:
626
627 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
628
629         Reviewed by Maciej.
630         
631         - Have *.lut.h files #include lookup.h to eliminate surprising header
632         include order dependency.
633
634         * DerivedSources.make:
635         * kjs/array_object.cpp:
636         * kjs/date_object.cpp:
637         * kjs/date_object.h:
638         (KJS::DateProtoFunc::):
639         * kjs/lexer.cpp:
640         * kjs/math_object.cpp:
641         * kjs/number_object.cpp:
642         * kjs/regexp_object.cpp:
643         * kjs/string_object.cpp:
644
645 2006-06-10  Geoffrey Garen  <ggaren@apple.com>
646
647         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
648         Linux porting compile bug
649         
650         Fix by Mike Emmel, Reviewed by Darin.
651
652         * JavaScriptCoreSources.bkl:
653         * jscore.bkl:
654         * wtf/Platform.h:
655
656 2006-06-09  Geoffrey Garen  <ggaren@apple.com>
657
658         Build fix -- I think :).
659
660         * JavaScriptCore.xcodeproj/project.pbxproj:
661         * kjs/context.h:
662
663 2006-06-09  Geoffrey Garen  <ggaren@apple.com>
664
665         Reviewed by Eric (yay!).
666         
667         - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
668         split Context into its own file -- Context.cpp -- renamed _var to m_var,
669         change ' *' to '* '.
670
671         * JavaScriptCore.xcodeproj/project.pbxproj:
672         * kjs/Context.cpp: Added.
673         (KJS::Context::Context):
674         (KJS::Context::~Context):
675         (KJS::Context::mark):
676         * kjs/context.h:
677         (KJS::Context::scopeChain):
678         (KJS::Context::variableObject):
679         (KJS::Context::setVariableObject):
680         (KJS::Context::thisValue):
681         (KJS::Context::callingContext):
682         (KJS::Context::activationObject):
683         (KJS::Context::currentBody):
684         (KJS::Context::function):
685         (KJS::Context::arguments):
686         (KJS::Context::pushScope):
687         (KJS::Context::seenLabels):
688         * kjs/function.cpp:
689         (KJS::FunctionImp::callAsFunction):
690         (KJS::FunctionImp::processParameters):
691         (KJS::FunctionImp::argumentsGetter):
692         (KJS::GlobalFuncImp::callAsFunction):
693         * kjs/internal.cpp:
694         (KJS::InterpreterImp::evaluate):
695         * kjs/internal.h:
696         (KJS::InterpreterImp::setContext):
697         (KJS::InterpreterImp::context):
698         * kjs/interpreter.cpp:
699         * kjs/interpreter.h:
700         (KJS::ExecState::context):
701         (KJS::ExecState::ExecState):
702         * kjs/nodes.cpp:
703         (currentSourceId):
704         (currentSourceURL):
705         (ThisNode::evaluate):
706         (ResolveNode::evaluate):
707         (FunctionCallResolveNode::evaluate):
708         (PostfixResolveNode::evaluate):
709         (DeleteResolveNode::evaluate):
710         (TypeOfResolveNode::evaluate):
711         (PrefixResolveNode::evaluate):
712         (AssignResolveNode::evaluate):
713         (VarDeclNode::evaluate):
714         (VarDeclNode::processVarDecls):
715         (DoWhileNode::execute):
716         (WhileNode::execute):
717         (ForNode::execute):
718         (ForInNode::execute):
719         (ContinueNode::execute):
720         (BreakNode::execute):
721         (ReturnNode::execute):
722         (WithNode::execute):
723         (SwitchNode::execute):
724         (LabelNode::execute):
725         (TryNode::execute):
726         (FuncDeclNode::processFuncDecl):
727         (FuncExprNode::evaluate):
728
729 2006-06-07  Geoffrey Garen  <ggaren@apple.com>
730
731         Removed API directory I prematurely/accidentally added.
732
733         * API: Removed.
734
735 2006-06-05  Mitz Pettel  <opendarwin.org@mitzpettel.com>
736
737         Reviewed and landed by Geoff.
738
739         - fix a regression in ecma_3/String/regress-104375.js
740
741         * kjs/string_object.cpp:
742         (substituteBackreferences): If a 2-digit back reference is out of range,
743         parse it as a 1-digit reference (followed by the other digit). This matches
744         Firefox's behavior.
745
746 2006-06-05  Geoffrey Garen  <ggaren@apple.com>
747
748         Reviewed By Maciej.
749         Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
750         
751         - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
752
753         No test case because there's no behavior change.
754         
755         * pcre/pcre_compile.c:
756         (read_repeat_counts): Check for integer overflow / out of bounds
757
758 2006-06-05  Geoffrey Garen  <ggaren@apple.com>
759
760         Reviewed by aliu.
761
762         - Changed CString length from int to size_t. We sould probably do this
763         for UString, too. (Darin, if you're reading this: Maciej said so.)
764         
765         * kjs/function.cpp:
766         (KJS::encode):
767         * kjs/ustring.cpp:
768         (KJS::CString::CString):
769         (KJS::operator==):
770         * kjs/ustring.h:
771         (KJS::CString::size):
772
773 2006-06-04  Geoffrey Garen  <ggaren@apple.com>
774
775         Reviewed by Maciej.
776         
777         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
778         Minor cleanup in JavaScriptCore
779
780         * kjs/value.h: Removed redundant declarations
781
782 2006-06-04  Darin Adler  <darin@apple.com>
783
784         Reviewed by Anders.
785
786         - changed deleteAllValues so it can work on "const" collections
787           Deleting the values affects the values, not the pointers in the
788           collection, so it's legitimate to do it to a const collection,
789           and a case of that actually came up in the XPath code.
790
791         * wtf/HashMap.h:
792         (WTF::deleteAllPairSeconds): Use const iterators.
793         (WTF::deleteAllValues): Take const HashMap reference as a parameter.
794         * wtf/HashSet.h:
795         (WTF::deleteAllValues): Take const HashSet reference as a parameter,
796         and use const iterators.
797         * wtf/Vector.h:
798         (WTF::deleteAllValues): Take const Vector reference as a parameter.
799
800         - added more functions that are present in <math.h> on some platforms,
801           but not on others; moved here from various files in WebCore
802
803         * wtf/MathExtras.h:
804         (isinf): Added.
805         (isnan): Added.
806         (lround): Added.
807         (lroundf): Tweaked.
808         (round): Added.
809         (roundf): Tweaked.
810         (signbit): Added.
811
812 2006-06-02  Mitz Pettel  <opendarwin.org@mitzpettel.com>
813
814         Reviewed by ggaren.
815
816         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
817           Implement $&, $' and $` replacement codes in String.prototype.replace
818
819         Test: fast/js/string-replace-3.html
820
821         * kjs/string_object.cpp:
822         (substituteBackreferences): Added support for $& (matched substring),
823         $` (everything preceding matched substring), $' (everything following
824         matched substring) and 2-digit back references, and cleaned up a little.
825
826 2006-06-02 Adele Peterson  <adele@apple.com>
827
828         Reviewed by Darin.
829
830         Set incremental linking to no. This seems to fix a build problem I was seeing
831         where dftables couldn't find a dll. 
832
833         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
834
835 2006-05-26  Steve Falkenburg  <sfalken@apple.com>
836
837         Build fixes/tweaks
838
839         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
840
841 === JavaScriptCore-521.11 ===
842
843 2006-05-24  Geoffrey Garen  <ggaren@apple.com>
844
845         Reviewed by mjs.
846         
847         - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
848         occurs when attempting to view image in slideshow mode at
849         http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
850         (KJS::ExecState*) + 312)
851
852         On alternate threads, DOMObjects remain in the
853         ScriptInterpreter's cache because they're not collected. So, they
854         need an opportunity to mark their children.
855         
856         I'm not particularly happy with this solution because it fails to
857         resolve many outstanding issues with the DOM object cache. Since none
858         of those issues is a crasher or a serious compatibility concern,
859         and since the behavior of other browsers is not much to go on in this
860         case, I've filed <rdar://problem/4561439> about that, and I'm moving on 
861         with my life.
862
863         * JavaScriptCore.xcodeproj/project.pbxproj:
864         * kjs/collector.cpp:
865         (KJS::Collector::collect):
866         * kjs/internal.cpp:
867         (KJS::InterpreterImp::mark):
868         * kjs/internal.h:
869         * kjs/interpreter.cpp:
870         (KJS::Interpreter::mark):
871         * kjs/interpreter.h:
872
873 === JavaScriptCore-521.10 ===
874
875 2006-05-22  Timothy Hatcher  <timothy@apple.com>
876
877         Reviewed by Eric, Kevin and Geoff.
878
879         Merge open source build fixes. <rdar://problem/4555500>
880
881         * kjs/collector.cpp: look at the rsp register in x86_64 
882         (KJS::Collector::markOtherThreadConservatively):
883         * wtf/Platform.h: add x86_64 to the platform list
884
885 2006-05-19  Anders Carlsson  <acarlsson@apple.com>
886
887         Reviewed by Geoff.
888
889         http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
890         Support function declaration in case statements
891         
892         * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
893         
894         * kjs/nodes.cpp:
895         (CaseClauseNode::evalStatements):
896         (CaseClauseNode::processVarDecls):
897         (CaseClauseNode::processFuncDecl):
898         (ClauseListNode::processFuncDecl):
899         (CaseBlockNode::processFuncDecl):
900         (SwitchNode::processFuncDecl):
901         * kjs/nodes.h:
902         (KJS::CaseClauseNode::CaseClauseNode):
903         (KJS::ClauseListNode::ClauseListNode):
904         (KJS::ClauseListNode::getClause):
905         (KJS::ClauseListNode::getNext):
906         (KJS::ClauseListNode::releaseNext):
907         (KJS::SwitchNode::SwitchNode):
908         Add processFuncDecl for the relevant nodes.        
909
910         * kjs/nodes2string.cpp:
911         (CaseClauseNode::streamTo):
912         next got renamed to source.
913
914 2006-05-17  George Staikos <staikos@kde.org>
915
916         Reviewed by Maciej, Alexey, and Eric.
917
918         * pcre/pcre_compile.c:
919         * pcre/pcre_get.c:
920         * pcre/pcre_exec.c:
921         * wtf/UnusedParam.h:
922         Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
923
924         * kjs/testkjs.cpp:
925         Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
926
927         * wtf/unicode/qt4/UnicodeQt4.h:
928         Use correct parentheses and correct mask for utf-32 support.
929
930 2006-05-17  Alexey Proskuryakov  <ap@nypop.com>
931
932         Reviewed by Darin.
933
934         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
935         Crash typing in Yahoo auto-complete widget.
936
937         Test: fast/js/regexp-stack-overflow.html
938
939         * pcre/pcre-config.h: Define NO_RECURSE.
940
941 2006-05-16  George Staikos <staikos@kde.org>
942
943         Reviewed by Maciej.
944
945         Fix some warnings and strict compilation errors.
946
947         * kjs/nodes.cpp: 
948         * kjs/value.cpp: 
949
950 2006-05-15  Alexey Proskuryakov  <ap@nypop.com>
951
952         * make-generated-sources.sh: Changed to be executable and removed
953         text in the file generated by "svn diff".
954
955 2006-05-15  Geoffrey Garen  <ggaren@apple.com>
956
957         Reviewed by Maciej.
958
959         - Fixed <rdar://problem/4534904> please do not treat "debugger" as
960         a reserved word while parsing JavaScript (and other ECMA reserved
961         words) 
962
963         AKA 
964
965         http://bugzilla.opendarwin.org/show_bug.cgi?id=6179 
966         We treat "char" as a reserved word in JavaScript and firefox/IE do
967         not
968
969         (1) I unreserved most of the spec's "future reserved words" because 
970         they're not reserved in IE or FF. (Most, but not all, because IE
971         somewhat randomly *does* reserve a few of them.)
972         (2) I made 'debugger' a legitimate statement that acts like an empty
973         statement because FF and IE support it.
974         
975         * kjs/grammar.y:
976         * kjs/keywords.table:
977
978 2006-05-15  Tim Omernick  <timo@apple.com>
979
980         Reviewed by John Sullivan.
981
982         Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
983
984         Added to the Netscape Plugin API the concept of "plugin drawing models".  The drawing model
985         determines the kind of graphics context created by the browser for the plugin, as well as 
986         the Mac types of various Netscape Plugin API data structures.
987
988         There is a drawing model to represent the old QuickDraw-based API.  It is used by default
989         if QuickDraw is available on the system, unless the plugin specifies another drawing model.
990
991         The big change is the addition of the CoreGraphics drawing model.  A plugin may request this
992         drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
993
994         * bindings/npapi.h:
995         Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
996         Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
997         variables.
998         Added NPDrawingModel enumeration.  Currently the only drawing models are QuickDraw and
999         CoreGraphics.
1000         NPRegion's type now depends on the drawing model specified by the plugin.
1001         NP_Port is now only defined when QuickDraw is available.
1002         Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
1003
1004 2006-05-13  Kevin M. Ollivier  <kevino@theolliviers.com>
1005
1006         Reviewed by Darin, landed by ap.
1007
1008         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
1009           Bakefiles (and generated Makefiles) for wx and gdk ports
1010
1011         * make-generated-sources.sh: 
1012         Added script to configure environment to run DerivedSources.make
1013         
1014         * JavaScriptCoreSources.bkl:
1015         Added JavaScriptCore sources list for Bakefile.
1016         
1017         * jscore.bkl:
1018         Bakefile used to generate JavaScriptCore project files 
1019         (currently only used by wx and gdk ports)
1020
1021 2006-05-09  Steve Falkenburg  <sfalken@apple.com>
1022
1023         Fix Windows build.
1024         Minor fixes to WTF headers.
1025         
1026         Reviewed by kevin.
1027
1028         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files. 
1029         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
1030         * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
1031         * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
1032
1033 2006-05-09  Maciej Stachowiak  <mjs@apple.com>
1034
1035         Rubber stamped by Anders.
1036         
1037         - renamed kxmlcore to wtf
1038         
1039         kxmlcore --> wtf
1040         KXMLCore --> WTF
1041         KXC --> WTF
1042
1043         * JavaScriptCore.xcodeproj/project.pbxproj:
1044         * bindings/c/c_instance.cpp:
1045         * bindings/objc/WebScriptObject.mm:
1046         * kjs/JSImmediate.h:
1047         * kjs/Parser.cpp:
1048         * kjs/Parser.h:
1049         * kjs/array_object.cpp:
1050         * kjs/collector.cpp:
1051         (KJS::Collector::registerThread):
1052         * kjs/collector.h:
1053         * kjs/config.h:
1054         * kjs/function.cpp:
1055         (KJS::isStrWhiteSpace):
1056         * kjs/function.h:
1057         * kjs/identifier.cpp:
1058         * kjs/internal.cpp:
1059         * kjs/internal.h:
1060         * kjs/lexer.cpp:
1061         (Lexer::shift):
1062         (Lexer::isWhiteSpace):
1063         (Lexer::isIdentStart):
1064         (Lexer::isIdentPart):
1065         * kjs/lookup.cpp:
1066         * kjs/nodes.cpp:
1067         * kjs/nodes.h:
1068         * kjs/number_object.cpp:
1069         * kjs/object.h:
1070         * kjs/property_map.cpp:
1071         * kjs/property_map.h:
1072         * kjs/string_object.cpp:
1073         (StringProtoFunc::callAsFunction):
1074         * kjs/testkjs.cpp:
1075         (testIsInteger):
1076         * kjs/ustring.cpp:
1077         * kjs/ustring.h:
1078         * kxmlcore: Removed.
1079         * kxmlcore/AlwaysInline.h: Removed.
1080         * kxmlcore/Assertions.cpp: Removed.
1081         * kxmlcore/Assertions.h: Removed.
1082         * kxmlcore/FastMalloc.cpp: Removed.
1083         * kxmlcore/FastMalloc.h: Removed.
1084         * kxmlcore/FastMallocInternal.h: Removed.
1085         * kxmlcore/Forward.h: Removed.
1086         * kxmlcore/HashCountedSet.h: Removed.
1087         * kxmlcore/HashFunctions.h: Removed.
1088         * kxmlcore/HashMap.h: Removed.
1089         * kxmlcore/HashSet.h: Removed.
1090         * kxmlcore/HashTable.cpp: Removed.
1091         * kxmlcore/HashTable.h: Removed.
1092         * kxmlcore/HashTraits.h: Removed.
1093         * kxmlcore/ListRefPtr.h: Removed.
1094         * kxmlcore/Noncopyable.h: Removed.
1095         * kxmlcore/OwnArrayPtr.h: Removed.
1096         * kxmlcore/OwnPtr.h: Removed.
1097         * kxmlcore/PassRefPtr.h: Removed.
1098         * kxmlcore/Platform.h: Removed.
1099         * kxmlcore/RefPtr.h: Removed.
1100         * kxmlcore/TCPageMap.h: Removed.
1101         * kxmlcore/TCSpinLock.h: Removed.
1102         * kxmlcore/TCSystemAlloc.cpp: Removed.
1103         * kxmlcore/TCSystemAlloc.h: Removed.
1104         * kxmlcore/UnusedParam.h: Removed.
1105         * kxmlcore/Vector.h: Removed.
1106         * kxmlcore/VectorTraits.h: Removed.
1107         * kxmlcore/unicode: Removed.
1108         * kxmlcore/unicode/Unicode.h: Removed.
1109         * kxmlcore/unicode/UnicodeCategory.h: Removed.
1110         * kxmlcore/unicode/icu: Removed.
1111         * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
1112         * kxmlcore/unicode/posix: Removed.
1113         * kxmlcore/unicode/qt3: Removed.
1114         * kxmlcore/unicode/qt4: Removed.
1115         * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
1116         * pcre/pcre_get.c:
1117         * wtf: Added.
1118         * wtf/Assertions.cpp:
1119         * wtf/Assertions.h:
1120         * wtf/FastMalloc.cpp:
1121         (WTF::TCMalloc_ThreadCache::Scavenge):
1122         (WTF::do_malloc):
1123         (WTF::do_free):
1124         (WTF::TCMallocGuard::TCMallocGuard):
1125         (WTF::malloc):
1126         (WTF::free):
1127         (WTF::calloc):
1128         (WTF::cfree):
1129         (WTF::realloc):
1130         * wtf/FastMalloc.h:
1131         * wtf/FastMallocInternal.h:
1132         * wtf/Forward.h:
1133         * wtf/HashCountedSet.h:
1134         * wtf/HashFunctions.h:
1135         * wtf/HashMap.h:
1136         * wtf/HashSet.h:
1137         * wtf/HashTable.cpp:
1138         * wtf/HashTable.h:
1139         * wtf/HashTraits.h:
1140         * wtf/ListRefPtr.h:
1141         * wtf/Noncopyable.h:
1142         * wtf/OwnArrayPtr.h:
1143         * wtf/OwnPtr.h:
1144         * wtf/PassRefPtr.h:
1145         * wtf/RefPtr.h:
1146         * wtf/TCSystemAlloc.cpp:
1147         (TCMalloc_SystemAlloc):
1148         * wtf/Vector.h:
1149         * wtf/VectorTraits.h:
1150         * wtf/unicode/UnicodeCategory.h:
1151         * wtf/unicode/icu/UnicodeIcu.h:
1152
1153 2006-05-08  Timothy Hatcher  <timothy@apple.com>
1154
1155         Reviewed by Tim O.
1156
1157         * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
1158
1159 2006-05-07  Darin Adler  <darin@apple.com>
1160
1161         Reviewed and landed by Maciej.
1162
1163         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
1164         Random crashes on TOT since the form state change
1165         
1166         I haven't figured out how to construct a test for this, but this does seem to fix the
1167         problem; Mitz mentioned that a double-destroy was occurring in these functions.
1168         
1169         * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
1170         ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
1171         destroys the element based on the storage type. The RefCounter template correctly does work
1172         only in cases where ValueType and ValueStorageType differ and this class is what's used
1173         elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
1174         * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
1175         
1176 2006-05-05  Darin Adler  <darin@apple.com>
1177
1178         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
1179           IE compatibility fix in date parsing
1180
1181         * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
1182         from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
1183
1184 2006-05-04  Anders Carlsson  <andersca@mac.com>
1185
1186         Reviewed by Maciej.
1187
1188         http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
1189         Would like a Vector::append that takes another Vector
1190         
1191         * kxmlcore/Vector.h:
1192         (KXMLCore::::append):
1193         New function that takes another array.
1194
1195 2006-05-02  Steve Falkenburg  <sfalken@apple.com>
1196
1197         Reviewed by eric.
1198
1199         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
1200         * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
1201
1202 2006-05-02  Anders Carlsson  <andersca@mac.com>
1203
1204         Reviewed by Maciej.
1205
1206         * kxmlcore/HashMap.h:
1207         (KXMLCore::::operator):
1208         Return *this
1209
1210 2006-05-01  Tim Omernick  <timo@apple.com>
1211
1212         Reviewed by Tim Hatcher.
1213
1214         <rdar://problem/4476875> Support printing for embedded Netscape plugins
1215
1216         * bindings/npapi.h:
1217         Fixed struct alignment problem in our npapi.h.  Structs must be 68k-aligned on both pre-Mac OS X
1218         and Mac OS X systems, as this is what plugins expect.
1219
1220 2006-05-01  Timothy Hatcher  <timothy@apple.com>
1221
1222         Reviewed by Maciej.
1223         
1224         <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
1225
1226         The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread || 
1227         imp->m_destructorIsThreadSafe" where we collect oversized cells.
1228
1229         We don't have a way to test PAC files yet, so there's no test attached.
1230
1231         * kjs/collector.cpp:
1232         (KJS::Collector::collect): test the thread when we collect oversized cells
1233
1234 2006-05-01  Tim Omernick  <timo@apple.com>
1235
1236         Reviewed by Adele.
1237
1238         <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
1239
1240         * kxmlcore/Assertions.cpp:
1241         Changed sense of strstr("%@") check.  I already made the same fix to the WebBrowser assertions.
1242
1243 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
1244
1245         Reviewed by kdecker
1246         
1247         Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
1248
1249         * kjs/testkjs.cpp:
1250         (main): Suppress C runtime alerts
1251
1252 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
1253
1254         Reviewed by kdecker
1255
1256         Suppress error reporting dialog that blocks Javascript tests from completing.
1257         
1258         Real error is due to an overflow in the date/time handling functions that needs
1259         to be addressed, but this will prevent the hang running the Javascript tests
1260         on the build bot (along with the related changes).
1261         
1262         * kjs/testkjs.cpp:
1263         (main): Suppress C runtime alerts
1264
1265 2006-04-27  Geoffrey Garen  <ggaren@apple.com>
1266
1267         Reviewed by Maciej
1268
1269         - Minor fixups I discovered while working on the autogenerator.
1270         
1271         * kjs/lookup.cpp:
1272         (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
1273         compute a garbage address, and possibly crash.
1274         * kjs/lookup.h:
1275         (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
1276         would be hidden entirely.
1277
1278 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
1279
1280         Reviewed by Darin.
1281
1282         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
1283           Compilation fixes for building on gcc 4.0.2, and without precomp headers
1284
1285         * kjs/operations.h:
1286         * kxmlcore/Assertions.cpp:
1287         * kxmlcore/FastMalloc.cpp:
1288         Added necessary headers to resolve compilation issues when not using
1289         precompiled headers.
1290         
1291         * kjs/value.h: Declare the JSCell class before friend declaration  
1292         to resolve compilation issues with gcc 4.0.2.
1293         
1294         * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
1295         other than KDE (previously only defined for Win and Mac OS)
1296                 
1297 2006-04-18  Eric Seidel  <eseidel@apple.com>
1298
1299         Reviewed by ggaren.
1300
1301         Fix "new Function()" to correctly use lexical scoping.
1302         Add ScopeChain::print() function for debugging.
1303         <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
1304
1305         * kjs/function_object.cpp:
1306         (FunctionObjectImp::construct):
1307         * kjs/scope_chain.cpp:
1308         (KJS::ScopeChain::print):
1309         * kjs/scope_chain.h:
1310
1311 2006-04-14  James G. Speth  <speth@end.com>
1312
1313         Reviewed by Timothy.
1314
1315         Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
1316         http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
1317
1318         Adds a category to WebScriptObject with array accessors for KVC/KVO.
1319
1320         If super valueForKey: fails it will call valueForUndefinedKey:, which is
1321         important because it causes the right behavior to happen with bindings using
1322         the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
1323
1324         * bindings/objc/WebScriptObject.mm:
1325         (-[WebScriptObject valueForKey:]):
1326         (-[WebScriptObject count]):
1327         (-[WebScriptObject objectAtIndex:]):
1328         (-[WebUndefined description]): return "undefined"
1329
1330 2006-04-13  Geoffrey Garen  <ggaren@apple.com>
1331
1332         Reviewed by Darin.
1333
1334         * kjs/internal.cpp:
1335         (KJS::InterpreterImp::initGlobalObject): Add the built-in object
1336         prototype to the end of the global object's prototype chain instead of
1337         just blowing away its existing prototype. We need to do this because
1338         the window object has a meaningful prototype now.
1339
1340 2006-04-13  Maciej Stachowiak  <mjs@apple.com>
1341
1342         Reviewed by Geoff.
1343         
1344         - fix testkjs to not show false-positive KJS::Node leaks in debug builds
1345
1346         * kjs/testkjs.cpp:
1347         (doIt):
1348         (kjsmain):
1349
1350 2006-04-11  Geoffrey Garen  <ggaren@apple.com>
1351
1352         Reviewed by Maciej.
1353
1354         Minor code cleanup -- passes all the JS tests.
1355
1356         * kjs/object_object.cpp:
1357         (ObjectObjectImp::construct):
1358         (ObjectObjectImp::callAsFunction):
1359
1360 2006-04-11  Darin Adler  <darin@apple.com>
1361
1362         - another attempt to fix Windows build -- Vector in Forward.h was not working
1363
1364         * kxmlcore/Forward.h: Remove Vector.
1365         * kxmlcore/Vector.h: Add back default arguments, remove include of
1366         Forward.h.
1367
1368 2006-04-11  Darin Adler  <darin@apple.com>
1369
1370         - try to fix Windows build -- HashForward.h was not working
1371
1372         * kxmlcore/HashForward.h: Removed.
1373
1374         * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
1375         * kjs/collector.h: Remove use of HashForward.h.
1376         * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
1377         default arguments.
1378         * kxmlcore/HashMap.h: Ditto.
1379         * kxmlcore/HashSet.h: Ditto.
1380
1381 2006-04-11  David Harrison  <harrison@apple.com>
1382
1383         Reviewed by Darin.
1384
1385         - fixed clean build, broken by Darin's check-in
1386
1387         * kjs/date_object.cpp: Add needed include of lookup.h.
1388         * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
1389
1390 2006-04-10  Darin Adler  <darin@apple.com>
1391
1392         Rubber-stamped by John Sullivan.
1393
1394         - switched from a shell script to a makefile for generated files
1395         - removed lots of unneeded includes
1396         - added new Forward.h and HashForward.h headers that allow compiling with
1397           fewer unneeded templates
1398
1399         * DerivedSources.make: Added.
1400         * generate-derived-sources: Removed.
1401         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
1402         DerivedSources.make.
1403
1404         * kxmlcore/Forward.h: Added.
1405         * kxmlcore/HashForward.h: Added.
1406
1407         * kxmlcore/HashCountedSet.h: Include HashForward for default args.
1408         * kxmlcore/HashMap.h: Ditto.
1409         * kxmlcore/HashSet.h: Ditto.
1410
1411         * kjs/object.h:
1412         * kjs/object.cpp:
1413         Moved KJS_MAX_STACK into the .cpp file.
1414
1415         * bindings/NP_jsobject.cpp:
1416         * bindings/c/c_instance.h:
1417         * bindings/jni/jni_class.h:
1418         * bindings/jni/jni_runtime.h:
1419         * bindings/jni/jni_utility.h:
1420         * bindings/objc/WebScriptObject.mm:
1421         * bindings/objc/WebScriptObjectPrivate.h:
1422         * bindings/objc/objc_class.h:
1423         * bindings/objc/objc_class.mm:
1424         * bindings/objc/objc_instance.h:
1425         * bindings/objc/objc_instance.mm:
1426         * bindings/objc/objc_runtime.mm:
1427         * bindings/objc/objc_utility.mm:
1428         * bindings/runtime.h:
1429         * bindings/runtime_array.cpp:
1430         * bindings/runtime_array.h:
1431         * bindings/runtime_method.cpp:
1432         * bindings/runtime_method.h:
1433         * bindings/runtime_object.cpp:
1434         * bindings/runtime_root.h:
1435         * kjs/JSImmediate.cpp:
1436         * kjs/Parser.h:
1437         * kjs/array_object.cpp:
1438         * kjs/array_object.h:
1439         * kjs/bool_object.cpp:
1440         * kjs/bool_object.h:
1441         * kjs/collector.h:
1442         * kjs/context.h:
1443         * kjs/debugger.cpp:
1444         * kjs/error_object.h:
1445         * kjs/function_object.h:
1446         * kjs/internal.h:
1447         * kjs/lexer.cpp:
1448         * kjs/math_object.cpp:
1449         * kjs/math_object.h:
1450         * kjs/nodes.cpp:
1451         * kjs/nodes.h:
1452         * kjs/number_object.cpp:
1453         * kjs/number_object.h:
1454         * kjs/object_object.cpp:
1455         * kjs/operations.cpp:
1456         * kjs/protected_reference.h:
1457         * kjs/reference.h:
1458         * kjs/reference_list.h:
1459         * kjs/regexp_object.h:
1460         * kjs/string_object.cpp:
1461         * kjs/string_object.h:
1462         * kjs/testkjs.cpp:
1463         * kjs/value.cpp:
1464         * kjs/value.h:
1465         * kxmlcore/HashTable.h:
1466         * kxmlcore/ListRefPtr.h:
1467         * kxmlcore/TCPageMap.h:
1468         * kxmlcore/Vector.h:
1469         Removed unneeded header includes.
1470
1471 2006-04-09  Geoffrey Garen  <ggaren@apple.com>
1472
1473         Reviewed by eric.
1474
1475         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
1476         prevent unnecessary entries in the "nodes with extra refs" hash table
1477
1478         This patch switches manually RefPtr exchange with use of
1479         RefPtr::release to ensure that a node's ref count never tops 1
1480         (in the normal case).
1481
1482         * kjs/nodes.cpp:
1483         (BlockNode::BlockNode):
1484         (CaseBlockNode::CaseBlockNode):
1485         * kjs/nodes.h:
1486         (KJS::ArrayNode::ArrayNode):
1487         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1488         (KJS::ArgumentsNode::ArgumentsNode):
1489         (KJS::VarStatementNode::VarStatementNode):
1490         (KJS::ForNode::ForNode):
1491         (KJS::CaseClauseNode::CaseClauseNode):
1492         (KJS::FuncExprNode::FuncExprNode):
1493         (KJS::FuncDeclNode::FuncDeclNode):
1494
1495 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
1496
1497         Reviewed by Darin.
1498
1499         One more attempt - use reinterpret_cast, rather than static_cast.
1500
1501 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
1502
1503         Reviewed by Darin.
1504
1505         An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
1506
1507         * kxmlcore/unicode/icu/UnicodeIcu.h:
1508         (KXMLCore::Unicode::toLower):
1509         (KXMLCore::Unicode::toUpper):
1510
1511 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
1512
1513         Reviewed by Darin.
1514
1515         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
1516         toLowerCase and toUpperCase don't honor special mappings
1517
1518         Test: fast/js/string-capitalization.html
1519
1520         * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
1521         * icu/unicode/putil.h: Added (copied from WebCore).
1522         * icu/unicode/uiter.h: Ditto.
1523         * icu/unicode/ustring.h: Ditto.
1524         * kjs/string_object.cpp:
1525         (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
1526         * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
1527         * kjs/ustring.h: Ditto.
1528
1529         * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
1530         * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
1531
1532         * kxmlcore/unicode/icu/UnicodeIcu.h:
1533         (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
1534         (KXMLCore::Unicode::toUpper): Ditto.
1535         (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
1536         (KXMLCore::Unicode::isSeparatorSpace): Ditto.
1537         (KXMLCore::Unicode::category): Ditto.
1538         * kxmlcore/unicode/qt4/UnicodeQt4.h:
1539         (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
1540         (KXMLCore::Unicode::toUpper): Ditto.
1541         (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
1542         (KXMLCore::Unicode::isSeparatorSpace): Ditto.
1543         (KXMLCore::Unicode::category): Ditto.
1544
1545         * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
1546         * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
1547
1548 2006-04-05  Darin Adler  <darin@apple.com>
1549
1550         - attempt to fix Windows build
1551
1552         * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
1553         * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
1554
1555 2006-04-05  Darin Adler  <darin@apple.com>
1556
1557         - attempt to fix Windows build
1558
1559         * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
1560
1561 2006-04-05  Darin Adler  <darin@apple.com>
1562
1563         Reviewed by Maciej.
1564
1565         - fix memory leak introduced by the previous change
1566
1567         * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
1568         the value in question is a pair where one of the pair needs a ref and the other
1569         of the pair does not.
1570
1571 2006-04-05  Darin Adler  <darin@apple.com>
1572
1573         Reviewed by Maciej.
1574
1575         - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
1576           StringImpl hash traits deleted value creates an init routine for WebCore
1577           <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
1578
1579         Change HashMap and HashSet implementation so they fold various types together.
1580         This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
1581         and WebCore::String in terms of the underlying raw pointer type, and hence use
1582         -1 for the deleted value.
1583
1584         * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
1585         type to be used when storing a value that has the same layout as the type itself.
1586         This is used only for non-key cases. In the case of keys, the hash function must also
1587         be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
1588         Added a new bool to HashTraits, needsRef, which indicates whether the type needs
1589         explicit reference counting. If the type itself has needsRef true, but the storage
1590         type has needsRef false, then the HashSet or HashMap has to handle the reference
1591         counting explicitly. Added hash trait specializations for all signed integer values
1592         that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
1593         integer type of the same size so int and long will share code. Gave all pointers and
1594         RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
1595         TraitType and emptyValue definitions in the pointer specialization for HashTraits.
1596         Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
1597         Useful for types where we don't want to force the existence of deletedValue, such as
1598         the type of a pair in a HashMap which is not the actual storage type. Removed an
1599         unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
1600         template, which determines what type can be used to store a given hash key type with
1601         a given hash function, and specialized it for pointers and RefPtr so that pointer
1602         hash tables share an underlying HashTable that uses IntHash.
1603
1604         * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
1605         NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
1606         HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
1607         tables where the type stored is not the same as the real value type.
1608         
1609         * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
1610         integer type given a sizeof value. Renamed pointerHash to intHash and made it
1611         use overloading and take integer parameters. Added an IntHash struct which is
1612         a hash function that works for integers. Changed PtrHash to call IntHash with
1613         an appropriately sized integer. Made IntHash the default hash function for
1614         many integer types. Made PtrHash the default hash function for RefPtr as well
1615         as for raw pointers.
1616
1617         * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
1618         derived from the new traits. The HashTable will use the storage type and all
1619         necessary translation and ref/deref is done at the HashSet level. Also reorganized
1620         the file so that the HashSet is at the top and has no inline implementation inside
1621         it so it's easy to read the interface to HashSet.
1622
1623         * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
1624         derived from the new traits. The HashTable will use the storage type and all
1625         necessary translation and ref/deref is done at the HashMap level. Also reorganized
1626         the file so that the HashMap is at the top and has no inline implementation inside
1627         it so it's easy to read the interface to HashMap.
1628
1629         * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
1630
1631         * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
1632         and also remove some unnecessary build settings from the aggregate target that
1633         generates derived sources.
1634         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
1635
1636 2006-04-04  Timothy Hatcher  <timothy@apple.com>
1637
1638         Reviewed by Darin.
1639
1640         The Debug and Release frameworks are now built with install paths relative to the build products directory.
1641         This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore. 
1642
1643         * JavaScriptCore.xcodeproj/project.pbxproj:
1644
1645 2006-04-04  Eric Seidel  <eseidel@apple.com>
1646
1647         Reviewed by ggaren.
1648
1649         Fix win32 build.
1650         Disable ASSERT redefinition warnings for now.
1651
1652         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1653         * kxmlcore/Assertions.h:
1654
1655 2006-04-04  Bjrn Graf  <bjoern.graf@gmail.com>
1656
1657         Reviewed by ggaren & darin.  Landed by eseidel.
1658
1659         Integrate CURL version of gettimeofday
1660         http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
1661         Disable crash report dialogs for testkjs.exe in Release mode
1662         http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
1663
1664         * kjs/testkjs.cpp:
1665         (StopWatch::start):
1666         (StopWatch::stop):
1667         (StopWatch::getElapsedMS):
1668         (main):
1669         (kjsmain):
1670
1671 2006-04-04  Eric Seidel  <eseidel@apple.com>
1672
1673         Reviewed by mjs.
1674
1675         * kjs/number_object.cpp:
1676         (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
1677
1678 2006-03-12  Maciej Stachowiak  <mjs@apple.com>
1679
1680         Reviewed by Darin.
1681         
1682         - fixed "toPrecision sometimes messes up the last digit on intel Macs"
1683         http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
1684
1685         * kjs/number_object.cpp:
1686         (intPow10): Compute integer powers of 10 using exponentiation by squaring.
1687         (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
1688         plus a bit of refactoring.
1689
1690 2006-04-03  Darin Adler  <darin@apple.com>
1691
1692         - tweak config.h and Platform.h to try to get buildbot working
1693           (making some small changes at the same time)
1694
1695         * kjs/config.h: Removed now-unneeded HAVE_ICU.
1696         * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
1697         USE stuff to the end.
1698
1699 2006-04-03  George Staikos   <staikos@opensource.apple.com>
1700
1701         Reviewed by Maciej.
1702
1703         Fix Win32 build breakage from previous commit, remove unused forward.
1704
1705 2006-04-03  George Staikos   <staikos@opensource.apple.com>
1706
1707         Reviewed by Maciej.
1708
1709         Implement a unicode abstraction layer to make JavaScriptCore much more
1710         easily ported to other platforms without having to take in libicu.  Also
1711         makes the unicode related code easier to understand.
1712
1713 2006-04-03  Timothy Hatcher  <timothy@apple.com>
1714
1715         Reviewed by Adele.
1716
1717         Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
1718         Other 64 bit build fixes.
1719
1720         * kjs/collector.cpp:
1721         (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
1722         * kjs/dtoa.cpp:
1723         (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
1724         * bindings/jni/jni_utility.cpp:
1725         (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
1726         (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
1727         * bindings/runtime_root.cpp:
1728         (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
1729         (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
1730
1731 2006-03-31  Darin Adler  <darin@apple.com>
1732
1733         Reviewed by Geoff.
1734
1735         - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
1736
1737         * bindings/objc/WebScriptObject.h: Fixed comment.
1738
1739 2006-03-31  Eric Seidel  <eseidel@apple.com>
1740
1741         Reviewed by mjs.
1742
1743         A bit more code cleanup.
1744
1745         * bindings/c/c_utility.cpp:
1746         (KJS::Bindings::convertValueToNPVariant):
1747         * bindings/objc/objc_runtime.mm:
1748         (convertValueToObjcObject):
1749         * bindings/objc/objc_utility.mm:
1750         (KJS::Bindings::convertValueToObjcValue):
1751         * kjs/function.cpp:
1752         (KJS::GlobalFuncImp::callAsFunction):
1753         * kjs/interpreter.cpp:
1754         (KJS::ExecState::lexicalInterpreter):
1755         * kjs/interpreter.h:
1756         * kjs/operations.cpp:
1757         (KJS::equal):
1758
1759 2006-03-30  Eric Seidel  <eseidel@apple.com>
1760
1761         Reviewed by anders.
1762
1763         Small code-style update.
1764
1765         * kjs/operations.cpp:
1766         (KJS::isNaN):
1767         (KJS::isInf):
1768         (KJS::isPosInf):
1769         (KJS::isNegInf):
1770         (KJS::equal):
1771         (KJS::strictEqual):
1772         (KJS::relation):
1773         (KJS::maxInt):
1774         (KJS::minInt):
1775         (KJS::add):
1776         (KJS::mult):
1777
1778 2006-03-31  Anders Carlsson  <andersca@mac.com>
1779
1780         Reviewed by Maciej.
1781
1782         Make sure the GetterSetterImp objects are marked as well.
1783         
1784         * kjs/internal.cpp:
1785         (KJS::GetterSetterImp::mark):
1786         Call JSCell::mark().
1787
1788 2006-03-30  Eric Seidel  <eseidel@apple.com>
1789
1790         Reviewed by ggaren.
1791
1792         * kjs/nodes.h: Some various small style fixes.
1793
1794 2006-03-30  Eric Seidel  <eseidel@apple.com>
1795
1796         Reviewed by ggaren.
1797
1798         Clean-up style issues in node.h, remove redundant initializations.
1799
1800         * kjs/nodes.h:
1801         (KJS::StatementNode::evaluate):
1802         (KJS::ArrayNode::ArrayNode):
1803         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1804         (KJS::ArgumentsNode::ArgumentsNode):
1805         (KJS::NewExprNode::NewExprNode):
1806         (KJS::CaseClauseNode::CaseClauseNode):
1807         (KJS::FuncDeclNode::FuncDeclNode):
1808
1809 2006-03-30  Tim Omernick  <timo@apple.com>
1810
1811         Reviewed by Geoff.
1812
1813         <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
1814         not object
1815
1816         * bindings/runtime.h:
1817         (KJS::Bindings::Instance::implementsCall):
1818         New method.  Returns false by default.  Concrete subclasses can override this return true when
1819         the bound object may be called as a function.
1820         (KJS::Bindings::Instance::invokeDefaultMethod):
1821         Since bound objects are no longer treated as functions by default, we can return jsUndefined()
1822         here instead of in concrete subclasses that decide not to implement the default method
1823         functionality.
1824
1825         * bindings/runtime_object.cpp:
1826         (RuntimeObjectImp::implementsCall):
1827         Don't assume that the bound object is a function; instead, let the object instance decide whether
1828         it is callable.
1829
1830         * bindings/c/c_instance.h:
1831         * bindings/c/c_instance.cpp:
1832         (KJS::Bindings::CInstance::implementsCall):
1833         The object is callable if its class has an invokeDefault function.
1834
1835         * bindings/objc/objc_instance.h:
1836         * bindings/objc/objc_instance.mm:
1837         (ObjcInstance::implementsCall):
1838         The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
1839
1840         * bindings/jni/jni_instance.h:
1841         * bindings/jni/jni_instance.cpp:
1842         Moved bogus invokeDefaultMethod() to superclass.
1843
1844 2006-03-29  Geoffrey Garen  <ggaren@apple.com>
1845
1846         Reviewed by Darin.
1847
1848         - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36 
1849         Regression: crash in malloc_consolidate if you use a .PAC file
1850
1851         The crash was a result of threaded deallocation of thread-unsafe
1852         objects. Pure JS objects are thread-safe because all JS execution
1853         is synchronized through JSLock. However, JS objects that wrap WebCore 
1854         objects are thread-unsafe because JS and WebCore execution are not 
1855         synchronized.  That unsafety comes into play when the collector 
1856         deallocates a JS object that wraps a WebCore object, thus causing the 
1857         WebCore object to be deallocated.
1858
1859         The solution here is to have each JSCell know whether it is safe to
1860         collect on a non-main thread, and to avoid collecting unsafe cells
1861         when on a non-main thread.
1862
1863         We don't have a way to test PAC files yet, so there's no test
1864         attached to this patch.
1865
1866         * kjs/collector.cpp:
1867         (KJS::Collector::collect):
1868         (1) Added the test "currentThreadIsMainThread || 
1869         imp->m_destructorIsThreadSafe". 
1870
1871         * kjs/protect.h:
1872         (KJS::gcProtectNullTolerant):
1873         (KJS::gcUnprotectNullTolerant):
1874         * kjs/value.h:
1875         (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
1876         m_destructorIsThreadSafe becomes another whole word, ruining the
1877         collector optimizations we've made based on the size of a JSObject.
1878         * kxmlcore/FastMalloc.cpp:
1879         (KXMLCore::currentThreadIsMainThread):
1880         (KXMLCore::fastMallocRegisterThread):
1881         * kxmlcore/FastMalloc.h:
1882
1883 2006-03-28  Darin Adler  <darin@apple.com>
1884
1885         Reviewed by Geoff.
1886
1887         - change some code that resulted in init routines on Mac OS X -- if the framework has
1888           init routines it will use memory and slow down applications that link with WebKit
1889           even in cases where those applications don't use WebKit
1890
1891         * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
1892         to use immediate numbers instead. Apparently, double constant expressions of the type we
1893         had here are evaluated at load time.
1894
1895         * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
1896         ListImp, so go back to using a plain old pointer.
1897         (KJS::List::List): Set overflow to 0 when initializing ListImp.
1898         (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
1899         (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
1900         a swap of OwnArrayPtr.
1901         (KJS::List::copyFrom): Remove now-unneeded get().
1902         (KJS::List::copyTail): Ditto.
1903
1904         * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
1905         a static initializer routine. Had to get rid of one level of constant to get the compiler
1906         to understand it could initialize without any code.
1907
1908         - added a build step that checks for init routines
1909
1910         * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
1911         was replaced by the generate-derived-sources script a while back. Added a custom build
1912         phase that invokes the check-for-global-initializers script.
1913
1914 2006-03-28  Timothy Hatcher  <timothy@apple.com>
1915
1916         Reviewed by Eric.
1917
1918         fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
1919
1920         * bindings/npapi.h: added #defines after the #ifndefs
1921
1922 2006-03-27  Maciej Stachowiak  <mjs@apple.com>
1923
1924         Reviewed by Anders.
1925         
1926         - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
1927
1928         * kjs/nodes.cpp:
1929         (Node::deref): take into account the case where the extra refcount table was never created
1930
1931 2006-03-23  David Carson <dacarson@gmail.com>
1932
1933         Reviewed by Darin.
1934         
1935         - JSObject in LiveConnect not working.
1936         http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
1937
1938         * bindings/jni_jsobject.cpp:
1939         (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
1940         class, and the GetFieldID was using the wrong signature.
1941
1942 2006-03-23  Darin Adler  <darin@apple.com>
1943
1944         Reviewed by Maciej.
1945
1946         - fix buildbot
1947
1948         * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
1949         Also add -Y 3 option for linker.
1950
1951 2006-03-23  Darin Adler  <darin@apple.com>
1952
1953         Reviewed by Maciej.
1954
1955         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
1956           REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
1957
1958         * kjs/object.h: Take function name, as well as source URL and line number, when
1959         using the special overloaded construct for making functions.
1960         * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
1961         * kjs/function_object.h: Ditto.
1962         * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
1963         constructing the function rather than null. Use "anonymous" when making a
1964         function using the default function constructor.
1965
1966         * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
1967         a function declaration.
1968
1969         - unrelated fix
1970
1971         * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
1972
1973 2006-03-23  Darin Adler  <darin@apple.com>
1974
1975         Reviewed by Maciej.
1976
1977         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
1978           LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
1979
1980         * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
1981         * bindings/c/c_utility.cpp:
1982         (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
1983         BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
1984         OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
1985         one case and remove a _NPN_ReleaseObject in another because this
1986         should return a retained value.
1987         (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
1988         NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
1989
1990         * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
1991         CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
1992         * bindings/c/c_runtime.cpp:
1993         (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
1994         method object.
1995         (KJS::Bindings::CField::name): Added. Returns the string from inside the
1996         field object.
1997         (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
1998         on the result of getProperty after using it to fix a storage leak.
1999         (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
2000         after pasing a value to setProperty now that the conversion function does a retain.
2001
2002         * bindings/c/c_instance.cpp:
2003         (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
2004         stack buffer. Removed special case for NPVARIANT_IS_VOID because the
2005         convertNPVariantToValue function handles that properly.
2006         (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
2007
2008         * bindings/NP_jsobject.h: Formatting changes only.
2009         * bindings/NP_jsobject.cpp:
2010         (jsDeallocate): Changed parameter type so we don't need a function cast.
2011         (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
2012         (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
2013         (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
2014         (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
2015
2016         * bindings/c/c_class.cpp: Formatting changes only.
2017         * bindings/c/c_class.h: Formatting changes only.
2018
2019         * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
2020         NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
2021         NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
2022         NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
2023         NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
2024         NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
2025         NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
2026         NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
2027         NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
2028         NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
2029         * bindings/npruntime.cpp:
2030         (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
2031         integer dictionary since the default behavior is fine for integers.
2032
2033 2006-03-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
2034
2035         Reviewed and landed by Maciej.
2036
2037         - WebKit no longer builds with bison 2.1
2038         http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
2039
2040         * generate-derived-sources:  Handle generated header named either grammar.cpp.h
2041         or grammar.hpp.
2042
2043 2006-03-22  Maciej Stachowiak  <mjs@apple.com>
2044
2045         - fix the build
2046
2047         * JavaScriptCore.xcodeproj/project.pbxproj:
2048
2049 2006-03-21  Maciej Stachowiak  <mjs@apple.com>
2050
2051         * kjs/generate-derived-sources: Set executable property.
2052
2053 2006-03-21  Maciej Stachowiak  <mjs@apple.com>
2054
2055         Reviewed by Darin.
2056         
2057         Ensure that generated source dependencies are handled properly, as follows:
2058         
2059         - Made an external script that generates the sources into a
2060           DerivedSources dir in the build products directory.
2061         - Added a new build target that builds all the generated sources
2062           if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
2063         - Added the DerivedSources dir in question to the include path.
2064         - Added the new DerivedSources dir and its contents to the project as build-relative.
2065         
2066         * JavaScriptCore.xcodeproj/project.pbxproj:
2067         * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
2068         can share more.
2069
2070 2006-03-11  Maciej Stachowiak  <mjs@apple.com>
2071
2072         Reviewed by Darin.
2073         
2074         - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
2075         http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
2076
2077         * kjs/ustring.cpp:
2078         (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
2079
2080 2006-03-16  Maciej Stachowiak  <mjs@apple.com>
2081
2082         Reviewed by Darin.
2083         
2084         - tweaks to my change to redo KJS::Node refcounting
2085
2086         * kjs/nodes.cpp:
2087         (Node::ref):
2088         (Node::deref):
2089         (Node::refcount):
2090         (Node::clearNewNodes):
2091         * kjs/nodes.h:
2092
2093 2006-03-16  Darin Adler  <darin@apple.com>
2094
2095         Reviewed by Maciej.
2096
2097         - fixed Vector so that you can pass a reference to something in the vector
2098           to the append or insert functions
2099
2100         * kxmlcore/Vector.h:
2101         (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
2102         and return the adjusted value of the pointer.
2103         (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
2104         adding the new element. Makes the case where the element moves when the vector
2105         is expanded work.
2106         (KXMLCore::Vector::insert): Ditto.
2107
2108 2006-03-15  Eric Seidel  <eseidel@apple.com>
2109
2110         Reviewed by adele.
2111
2112         Build fix.
2113
2114         * kjs/date_object.cpp:
2115         (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
2116
2117 2006-03-15  Eric Seidel  <eseidel@apple.com>
2118
2119         Reviewed by mjs.
2120
2121         Fix CString copy constructor, fixes Date.parse("") on Win32.
2122
2123         * kjs/date_object.cpp:
2124         (KJS::DateProtoFunc::callAsFunction):
2125         * kjs/ustring.cpp:
2126         (KJS::CString::CString):
2127         (KJS::CString::operator=):
2128
2129 2006-03-13  Maciej Stachowiak  <mjs@apple.com>
2130
2131         Reviewed by Anders.
2132         
2133         - KJS::Node and KJS::StatementNode are bigger than they need to be
2134         http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
2135
2136         The memory usage of Node was reduced by 2 machine words per node:
2137
2138         - sourceURL was removed and only kept on FunctionBodyNode. The
2139         source URL can only be distinct per function or top-level program node, 
2140         and you always have one.
2141         
2142         - refcount was removed and kept in a separate hashtable when
2143         greater than 1. newNodes set represents floating nodes with
2144         refcount of 0. This helps because almost all nodes have a refcount of 1
2145         for almost all of their lifetime.
2146         
2147         * bindings/runtime_method.cpp:
2148         (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
2149         * kjs/Parser.cpp:
2150         (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
2151         them at the appropriate time.
2152         * kjs/context.h:
2153         (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
2154         for current code.
2155         (KJS::ContextImp::pushIteration): moved here from LabelStack
2156         (KJS::ContextImp::popIteration): ditto
2157         (KJS::ContextImp::inIteration): ditto
2158         (KJS::ContextImp::pushSwitch): ditto
2159         (KJS::ContextImp::popSwitch): ditto
2160         (KJS::ContextImp::inSwitch): ditto
2161         * kjs/function.cpp:
2162         (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
2163         (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
2164         (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
2165         (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
2166         constructor.
2167         (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
2168         eval.
2169         * kjs/function.h: Move body field from DeclaredFunctionImp to
2170         FunctionImp.
2171         * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
2172         * kjs/internal.cpp:
2173         (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
2174         and m_switchDepth data members. New FunctionBodyNode* parameter - the
2175         function body provides source URL and SourceId.
2176         (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
2177         (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
2178         to use as the body.
2179         * kjs/internal.h:
2180         (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
2181         statement label stacks don't need these and it bloats their size. Put them
2182         in the ContextImp instead.
2183         * kjs/interpreter.cpp:
2184         (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
2185         * kjs/interpreter.h:
2186         (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
2187         (KJS::ExecState::context): ditto
2188         (KJS::ExecState::setException): Renamed _exception to m_exception
2189         (KJS::ExecState::clearException): ditto
2190         (KJS::ExecState::exception): ditto
2191         (KJS::ExecState::hadException): ditto
2192         (KJS::ExecState::ExecState): ditto both above renames
2193         * kjs/nodes.cpp:
2194         (Node::Node): Removed initialization of line, source URL and refcount. Add to
2195         local newNodes set instead of involving parser.
2196         (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
2197         HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
2198         0.
2199         (Node::deref): ditto
2200         (Node::refcount): ditto
2201         (Node::clearNewNodes): Destroy anything left in the new nodes set.
2202         (currentSourceId): Inline helper to get sourceId from function body via context.
2203         (currentSourceURL): ditto for sourceURL.
2204         (Node::createErrorCompletion): use new helper
2205         (Node::throwError): ditto
2206         (Node::setExceptionDetailsIfNeeded): ditto
2207         (StatementNode::StatementNode): remove initialization of l0 and sid, rename
2208         l1 to m_lastLine.
2209         (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
2210         (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
2211         (StatListNode::StatListNode): updated for setLoc changes
2212         (BlockNode::BlockNode): ditto
2213         (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
2214         (WhileNode::execute): ditto
2215         (ForNode::execute): ditto
2216         (ForInNode::execute): ditto
2217         (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
2218         (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
2219         (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
2220         (FunctionBodyNode::FunctionBodyNode): update for new setLoc
2221         (FunctionBodyNode::processFuncDecl): reindent
2222         (SourceElementsNode::SourceElementsNode): update for new setLoc
2223         * kjs/nodes.h:
2224         (KJS::Node::lineNo): Renamed _line to m_line
2225         (KJS::StatementNode::firstLine): Use lineNo()
2226         (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
2227         (KJS::FunctionBodyNode::sourceId): added
2228         (KJS::FunctionBodyNode::sourceURL): added
2229         * kjs/testkjs.cpp:
2230
2231 2006-03-14  Geoffrey Garen  <ggaren@apple.com>
2232
2233         - Fixed <rdar://problem/4478239> string sort puts "closed" before 
2234         "close"
2235
2236         Reviewed by Eric.
2237
2238         * kjs/ustring.cpp:
2239         (KJS::compare): Inverted a < in order to treat the longer string as > 
2240         the shorter string.
2241
2242 2006-03-12  Alexey Proskuryakov  <ap@nypop.com>
2243
2244         Reviewed by Maciej.
2245
2246         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
2247         REGRESSION: Flash callback to JavaScript function not working.
2248
2249         Test: plugins/invoke.html
2250
2251         * bindings/c/c_utility.cpp:
2252         (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
2253
2254 2006-03-08  Eric Seidel  <eseidel@apple.com>
2255
2256         Reviewed by darin.
2257
2258         Partially fix JS on win32 by fixing hash table generation.
2259
2260         * kjs/create_hash_table: limit << results to 32 bits.
2261         * kjs/testkjs.cpp:
2262         (TestFunctionImp::callAsFunction):
2263
2264 2006-03-07  Darin Adler  <darin@apple.com>
2265
2266         * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
2267
2268 2006-03-07  Darin Adler  <darin@apple.com>
2269
2270         Reviewed by Anders.
2271
2272         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
2273           unwanted output while running layout tests
2274
2275         * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
2276         * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
2277         to standard output. I think we should arrange for the error text to be in JavaScript
2278         exceptions instead at some point.
2279         * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
2280         too-large size rather than allocating a buffer smaller than requested.
2281
2282 2006-03-06  David Carson <dacarson@gmail.com>
2283
2284         Reviewed by Darin, landed by ap.
2285
2286         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
2287         c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
2288
2289         Tested with test case from:
2290         http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2291
2292         * bindings/c_utility.cpp
2293         (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
2294         * icu/unicode/ucnv.h: Copied from WebCore.
2295         * icu/unicode/ucnv_err.h: Ditto.
2296         * icu/unicode/uenum.h: Ditto.
2297
2298 2006-03-05  Darin Adler  <darin@apple.com>
2299
2300         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
2301
2302 2006-03-06  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2303
2304         Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
2305         
2306         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
2307           REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
2308
2309         * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
2310
2311 2006-03-05  Darin Adler  <darin@apple.com>
2312
2313         Reviewed by Maciej.
2314
2315         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
2316           get all references to KJS::Node out of internal.h
2317
2318         * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
2319
2320         * kjs/Parser.cpp: Added.
2321         * kjs/Parser.h: Added.
2322
2323         * kjs/internal.cpp: Removed the Parser class.
2324         * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
2325         not used in this header.
2326
2327         * kjs/nodes.h: Added an include of "Parser.h".
2328         * kjs/function.h: Added a declaration of FunctionBodyNode.
2329
2330 2006-03-05  Geoffrey Garen  <ggaren@apple.com>
2331
2332         Reviewed by Maciej.
2333
2334         - JSC support for the fix for <rdar://problem/4467143> JavaScript 
2335         enumeration of HTML element properties skips DOM node properties
2336
2337         * kjs/lookup.h: 
2338         (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The 
2339         class definiton macro needs to know about the prototype's prototype so 
2340         that the class constructor properly sets it. 
2341         (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
2342         implementation macro does not need to know about the prototype's
2343         prototype, since getOwnPropertySlot should only look in the current 
2344         object's property map, and not its prototype's.
2345
2346 2006-03-05  Andrew Wellington  <proton@wiretapped.net>
2347
2348         Reviewed by Eric, landed by ap.
2349         
2350         - Remove unused breakpoint bool from StatementNodes. No test provided as
2351         there is no functionality change.
2352
2353         * kjs/nodes.cpp:
2354         (StatementNode::StatementNode):
2355         * kjs/nodes.h:
2356
2357 2006-03-03  Geoffrey Garen  <ggaren@apple.com>
2358
2359         Reviewed by Darin.
2360
2361         - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at 
2362         http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
2363
2364         This regression was caused by my fix for 4448098. I failed to account for the
2365         deleted entry sentinel in the mehtod that saves the contents of a property map to 
2366         the back/forward cache.
2367
2368         Manual test in WebCore/manual-tests/property-map-save-crash.html
2369
2370         * kjs/property_map.cpp:
2371         (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
2372         (KJS::isValid): New function: checks if a key is null or the deleted sentinel
2373         (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
2374         and a slight performance win
2375         (KJS::PropertyMap::clear):
2376         (KJS::PropertyMap::rehash):
2377         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2378         (KJS::PropertyMap::save): Check keys with isValid()
2379
2380 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2381
2382         - now fix mac build again
2383
2384         * kjs/identifier.cpp:
2385
2386 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2387
2388         Rubber stamped by Anders and Eric.
2389
2390         - add fpconst.cpp to win32 build, it is now needed
2391
2392         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2393         * kjs/fpconst.cpp:
2394
2395 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2396
2397         Reviewed by Eric.
2398
2399         - fix windows build, broken by my last patch
2400
2401         * kjs/JSImmediate.cpp:
2402         * kjs/identifier.cpp:
2403         * kxmlcore/FastMalloc.cpp:
2404         * kxmlcore/Platform.h:
2405
2406 2006-03-01  Maciej Stachowiak  <mjs@apple.com>
2407
2408         Reviewed by Darin.
2409         
2410         - Set up new prototype macros and avoid using #if without defined() in JSC
2411         
2412         Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
2413         are defined, and to separate core OS-level dependencies from operating environment
2414         dependencies so you can, e.g., build KDE on Mac or Windows.
2415
2416         * kxmlcore/Platform.h: Added.
2417
2418         - deploy them everywhere in JavaScriptCore
2419         
2420         * JavaScriptCore.xcodeproj/project.pbxproj:
2421         * bindings/jni/jni_utility.cpp:
2422         (KJS::Bindings::convertValueToJValue):
2423         * bindings/objc/WebScriptObject.mm:
2424         * bindings/objc/objc_instance.mm:
2425         (ObjcInstance::end):
2426         * bindings/softlinking.h:
2427         * bindings/testbindings.mm:
2428         (main):
2429         * kjs/JSLock.cpp:
2430         * kjs/collector.cpp:
2431         (KJS::Collector::markCurrentThreadConservatively):
2432         (KJS::Collector::markOtherThreadConservatively):
2433         (KJS::Collector::markStackObjectsConservatively):
2434         * kjs/config.h:
2435         * kjs/date_object.cpp:
2436         (gmtoffset):
2437         (KJS::formatTime):
2438         (KJS::DateProtoFunc::callAsFunction):
2439         (KJS::DateObjectImp::construct):
2440         (KJS::makeTime):
2441         * kjs/dtoa.cpp:
2442         * kjs/fpconst.cpp:
2443         (KJS::sizeof):
2444         (KJS::):
2445         * kjs/grammar.y:
2446         * kjs/identifier.cpp:
2447         * kjs/internal.cpp:
2448         * kjs/interpreter.cpp:
2449         (KJS::Interpreter::evaluate):
2450         (KJS::Interpreter::createLanguageInstanceForValue):
2451         * kjs/interpreter.h:
2452         * kjs/lookup.cpp:
2453         * kjs/lookup.h:
2454         * kjs/math_object.cpp:
2455         * kjs/object.cpp:
2456         * kjs/object.h:
2457         * kjs/operations.cpp:
2458         (KJS::isNaN):
2459         (KJS::isInf):
2460         (KJS::isPosInf):
2461         (KJS::isNegInf):
2462         * kjs/operations.h:
2463         * kjs/regexp.cpp:
2464         (KJS::RegExp::RegExp):
2465         (KJS::RegExp::~RegExp):
2466         (KJS::RegExp::match):
2467         * kjs/regexp.h:
2468         * kjs/testkjs.cpp:
2469         (StopWatch::start):
2470         (StopWatch::stop):
2471         (StopWatch::getElapsedMS):
2472         * kjs/ustring.cpp:
2473         * kjs/ustring.h:
2474         * kxmlcore/AlwaysInline.h:
2475         * kxmlcore/Assertions.cpp:
2476         * kxmlcore/Assertions.h:
2477         * kxmlcore/FastMalloc.cpp:
2478         (KXMLCore::):
2479         * kxmlcore/FastMalloc.h:
2480         * kxmlcore/FastMallocInternal.h:
2481         * kxmlcore/HashTable.h:
2482         * kxmlcore/TCPageMap.h:
2483         * kxmlcore/TCSpinLock.h:
2484         (TCMalloc_SpinLock::Lock):
2485         (TCMalloc_SpinLock::Unlock):
2486         (TCMalloc_SlowLock):
2487         * kxmlcore/TCSystemAlloc.cpp:
2488         (TCMalloc_SystemAlloc):
2489         * os-win32/stdint.h:
2490
2491 2006-02-28  Geoffrey Garen  <ggaren@apple.com>
2492
2493         Reviewed by Darin.
2494
2495         - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry 
2496         placeholder to -1 from UString::Rep::null
2497
2498         This turned out to be only a small speedup (.12%). That's within the 
2499         margin of error for super accurate JS iBench, but Shark confirms the 
2500         same, so I think it's worth landing.
2501
2502         FYI, I also confirmed that the single entry optimization in 
2503         PropertyMap is a 3.2% speedup.
2504
2505         * kjs/property_map.cpp:
2506         (KJS::PropertyMap::~PropertyMap):
2507         (KJS::PropertyMap::clear):
2508         (KJS::PropertyMap::put):
2509         (KJS::PropertyMap::insert):
2510         (KJS::PropertyMap::rehash):
2511         (KJS::PropertyMap::remove):
2512         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2513         (KJS::PropertyMap::checkConsistency):
2514         * kjs/property_map.h:
2515         (KJS::PropertyMap::deletedSentinel):
2516
2517 2006-02-27  Eric Seidel  <eseidel@apple.com>
2518
2519         Rubber-stamped by darin.
2520
2521         Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
2522
2523         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2524
2525 2006-02-27  Eric Seidel  <eseidel@apple.com>
2526
2527         Reviewed by mjs.
2528
2529         Fix Assertions.cpp to compile on win32.
2530
2531         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2532         * kxmlcore/Assertions.cpp:
2533
2534 2006-02-27  Eric Seidel  <eseidel@apple.com>
2535
2536         Reviewed by mjs.
2537
2538         Made Assertions.cpp platform independent.
2539         Moved mac-specific logging logic up into WebCore.
2540         http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
2541
2542         * JavaScriptCore.xcodeproj/project.pbxproj:
2543         * kxmlcore/Assertions.cpp: Added.
2544         * kxmlcore/Assertions.h:
2545         * kxmlcore/Assertions.mm: Removed.
2546
2547 2006-02-27  Darin Adler  <darin@apple.com>
2548
2549         - fixed Mac Debug build, there was an unused parameter
2550
2551         * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
2552         Remove parameter name.
2553
2554         * kjs/debugger.h: Fixed comment.
2555
2556 2006-02-27  Eric Seidel  <eseidel@apple.com>
2557
2558         Reviewed by darin.
2559
2560         * kxmlcore/Vector.h:
2561         (KXMLCore::deleteAllValues): fix unused variable warning
2562
2563 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
2564
2565         Reviewed by Darin.
2566         
2567         - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
2568         http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
2569
2570         * JavaScriptCore.xcodeproj/project.pbxproj:
2571         * bindings/NP_jsobject.cpp:
2572         (jsAllocate):
2573         (_NPN_InvokeDefault):
2574         (_NPN_Evaluate):
2575         (_NPN_GetProperty):
2576         (_NPN_SetProperty):
2577         (_NPN_RemoveProperty):
2578         (_NPN_HasProperty):
2579         (_NPN_HasMethod):
2580         * bindings/c/c_class.h:
2581         (KJS::Bindings::CClass::constructorAt):
2582         * bindings/c/c_utility.cpp:
2583         (KJS::Bindings::convertNPVariantToValue):
2584         * bindings/jni/jni_class.cpp:
2585         (JavaClass::methodsNamed):
2586         (JavaClass::fieldNamed):
2587         * bindings/jni/jni_instance.cpp:
2588         (JavaInstance::invokeDefaultMethod):
2589         * bindings/jni/jni_jsobject.cpp:
2590         * bindings/jni/jni_objc.mm:
2591         (-[NSObject KJS::Bindings::]):
2592         * bindings/objc/WebScriptObject.mm:
2593         (+[WebUndefined allocWithZone:]):
2594         (-[WebUndefined initWithCoder:]):
2595         (-[WebUndefined encodeWithCoder:]):
2596         (-[WebUndefined copyWithZone:]):
2597         * bindings/objc/objc_class.h:
2598         (KJS::Bindings::ObjcClass::constructorAt):
2599         * bindings/objc/objc_class.mm:
2600         (KJS::Bindings::ObjcClass::methodsNamed):
2601         (KJS::Bindings::ObjcClass::fallbackObject):
2602         * bindings/objc/objc_instance.mm:
2603         (ObjcInstance::getValueOfUndefinedField):
2604         * bindings/objc/objc_runtime.mm:
2605         (ObjcFallbackObjectImp::getOwnPropertySlot):
2606         (ObjcFallbackObjectImp::put):
2607         (ObjcFallbackObjectImp::canPut):
2608         (ObjcFallbackObjectImp::deleteProperty):
2609         (ObjcFallbackObjectImp::toBoolean):
2610         * bindings/runtime.cpp:
2611         (KJS::Bindings::Instance::createLanguageInstanceForValue):
2612         * bindings/runtime.h:
2613         (KJS::Bindings::Instance::getValueOfUndefinedField):
2614         (KJS::Bindings::Instance::setValueOfUndefinedField):
2615         * bindings/runtime_array.cpp:
2616         (RuntimeArray::lengthGetter):
2617         (RuntimeArray::indexGetter):
2618         (RuntimeArray::put):
2619         (RuntimeArray::deleteProperty):
2620         * bindings/runtime_method.cpp:
2621         (RuntimeMethod::lengthGetter):
2622         (RuntimeMethod::execute):
2623         * bindings/runtime_object.cpp:
2624         (RuntimeObjectImp::fallbackObjectGetter):
2625         (RuntimeObjectImp::fieldGetter):
2626         (RuntimeObjectImp::methodGetter):
2627         (RuntimeObjectImp::put):
2628         (RuntimeObjectImp::canPut):
2629         (RuntimeObjectImp::deleteProperty):
2630         (RuntimeObjectImp::defaultValue):
2631         (RuntimeObjectImp::callAsFunction):
2632         * bindings/runtime_root.cpp:
2633         (performJavaScriptAccess):
2634         * kjs/array_object.cpp:
2635         (ArrayInstance::lengthGetter):
2636         (ArrayInstance::getOwnPropertySlot):
2637         (ArrayPrototype::ArrayPrototype):
2638         (ArrayPrototype::getOwnPropertySlot):
2639         * kjs/bool_object.cpp:
2640         (BooleanObjectImp::BooleanObjectImp):
2641         * kjs/date_object.cpp:
2642         (KJS::DateObjectFuncImp::DateObjectFuncImp):
2643         (KJS::DateObjectFuncImp::callAsFunction):
2644         * kjs/error_object.cpp:
2645         (ErrorObjectImp::ErrorObjectImp):
2646         (NativeErrorPrototype::NativeErrorPrototype):
2647         (NativeErrorImp::NativeErrorImp):
2648         * kjs/function.cpp:
2649         (KJS::FunctionImp::argumentsGetter):
2650         (KJS::FunctionImp::lengthGetter):
2651         (KJS::Arguments::mappedIndexGetter):
2652         (KJS::ActivationImp::argumentsGetter):
2653         (KJS::ActivationImp::put):
2654         * kjs/function_object.cpp:
2655         (FunctionObjectImp::FunctionObjectImp):
2656         * kjs/internal.cpp:
2657         (KJS::GetterSetterImp::toPrimitive):
2658         (KJS::GetterSetterImp::toBoolean):
2659         * kjs/interpreter.cpp:
2660         (KJS::Interpreter::evaluate):
2661         * kjs/interpreter.h:
2662         (KJS::Interpreter::isGlobalObject):
2663         (KJS::Interpreter::interpreterForGlobalObject):
2664         (KJS::Interpreter::isSafeScript):
2665         * kjs/lexer.cpp:
2666         (Lexer::makeIdentifier):
2667         (Lexer::makeUString):
2668         * kjs/lookup.h:
2669         (KJS::staticFunctionGetter):
2670         (KJS::staticValueGetter):
2671         * kjs/nodes.cpp:
2672         (StatementNode::processFuncDecl):
2673         (PropertyNode::evaluate):
2674         (PropertyNameNode::evaluate):
2675         * kjs/number_object.cpp:
2676         (NumberObjectImp::NumberObjectImp):
2677         (NumberObjectImp::getOwnPropertySlot):
2678         * kjs/object.cpp:
2679         (KJS::JSObject::defineGetter):
2680         (KJS::JSObject::defineSetter):
2681         (KJS::JSObject::hasInstance):
2682         (KJS::JSObject::propertyIsEnumerable):
2683         * kjs/object_object.cpp:
2684         (ObjectObjectImp::ObjectObjectImp):
2685         * kjs/property_slot.cpp:
2686         (KJS::PropertySlot::undefinedGetter):
2687         (KJS::PropertySlot::functionGetter):
2688         * kjs/reference.cpp:
2689         (KJS::Reference::getPropertyName):
2690         * kjs/reference_list.cpp:
2691         (ReferenceListIterator::operator++):
2692         * kjs/regexp_object.cpp:
2693         (RegExpObjectImp::RegExpObjectImp):
2694         (RegExpObjectImp::getValueProperty):
2695         (RegExpObjectImp::putValueProperty):
2696         * kjs/string_object.cpp:
2697         (StringInstance::lengthGetter):
2698         (StringInstance::indexGetter):
2699         (StringPrototype::StringPrototype):
2700         * kxmlcore/Assertions.mm:
2701         * kxmlcore/FastMalloc.cpp:
2702         (KXMLCore::TCMalloc_PageHeap::CheckList):
2703         * kxmlcore/HashTable.h:
2704         (KXMLCore::HashTableConstIterator::checkValidity):
2705         (KXMLCore::IdentityHashTranslator::translate):
2706         * pcre/pcre_get.c:
2707         (pcre_get_stringnumber):
2708
2709 2006-02-23  Darin Adler  <darin@apple.com>
2710
2711         - try to fix buildbot failure
2712
2713         * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
2714         recompiled after additional inlining was introduced (Xcode bug?).
2715
2716 2006-02-23  Geoffrey Garen  <ggaren@apple.com>
2717
2718         Reviewed by Darin, Maciej.
2719
2720         - Inline some functions suggested by Shark. 2.9% speedup on super
2721         accurate JS iBench.
2722
2723         http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
2724         <rdar://problem/4448116>
2725
2726         * kjs/nodes.h:
2727         (KJS::ArgumentsNode::evaluateList):
2728         * kjs/object.cpp:
2729         * kjs/object.h:
2730         (KJS::ScopeChain::release):
2731         (KJS::JSObject::toPrimitive):
2732         * kjs/scope_chain.cpp:
2733         * kjs/ustring.cpp:
2734         * kjs/ustring.h:
2735         (KJS::UString::toArrayIndex):
2736         * kjs/value.cpp:
2737         * kjs/value.h:
2738         (KJS::JSValue::toObject):
2739         * kxmlcore/FastMalloc.cpp:
2740         (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
2741         (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
2742
2743 2006-02-21  Eric Seidel  <eseidel@apple.com>
2744
2745         Added *.user to ignore list.
2746
2747 2006-02-21  Eric Seidel  <eseidel@apple.com>
2748
2749         Reviewed by ggaren.
2750
2751         Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
2752
2753         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2754         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
2755
2756 2006-02-21  Eric Seidel  <eseidel@apple.com>
2757
2758         Reviewed by ggaren.
2759
2760         * kjs/testkjs.cpp: #if out timeval code on win32
2761
2762 2006-02-21  Michael Emmel  <mike.emmel@gmail.com>
2763
2764         Reviewed by Darin.
2765
2766         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
2767           TCPageMap.h would not compile for me because string.h was missing
2768
2769         * kxmlcore/TCPageMap.h: Added <string.h> include.
2770
2771 2006-02-21  Darin Adler  <darin@apple.com>
2772
2773         Reviewed by John Sullivan.
2774
2775         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
2776           remove a bunch of extra implementsCall overrides
2777
2778         * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
2779
2780         * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
2781         we'll get a compile error if some derived class neglects to implement it.
2782
2783         * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
2784         of param, which is an OwnPtr so it gets initialized by default.
2785
2786         * bindings/runtime_method.cpp:
2787         * bindings/runtime_method.h:
2788         * kjs/array_object.cpp:
2789         * kjs/array_object.h:
2790         * kjs/bool_object.cpp:
2791         * kjs/bool_object.h:
2792         * kjs/date_object.cpp:
2793         * kjs/date_object.h:
2794         * kjs/error_object.cpp:
2795         * kjs/error_object.h:
2796         * kjs/function.cpp:
2797         * kjs/function.h:
2798         * kjs/function_object.cpp:
2799         * kjs/function_object.h:
2800         * kjs/math_object.cpp:
2801         * kjs/math_object.h:
2802         * kjs/number_object.cpp:
2803         * kjs/number_object.h:
2804         * kjs/object_object.cpp:
2805         * kjs/object_object.h:
2806         * kjs/regexp_object.cpp:
2807         * kjs/regexp_object.h:
2808         * kjs/string_object.cpp:
2809         * kjs/string_object.h:
2810         Removed many rendundant implementations of implementsCall from subclasses of
2811         InternalFunctionImp.
2812
2813 2006-02-21  Darin Adler  <darin@apple.com>
2814
2815         - fixed build
2816
2817         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
2818         Oops, fixed name.
2819
2820 2006-02-21  Darin Adler  <darin@apple.com>
2821
2822         Change suggested by Mitz.
2823
2824         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
2825           REGRESSION: Methods do not execute
2826
2827         * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
2828         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
2829         Return true. All the classes derived from InternalFunctionImp need
2830         to return true from this -- later we can remove all the extra
2831         implementations too.
2832
2833 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
2834
2835         - fix build breakage caused by last-minute change to my patch
2836
2837         * kjs/lookup.h:
2838
2839 2006-02-20  Maciej Stachowiak  <mjs@apple.com>
2840
2841         Reviewed by Geoff and Darin.
2842         
2843         Patch from Maks Orlovich, based on work by David Faure, hand-applied and 
2844         significantly reworked by me.
2845         
2846         - Patch: give internal function names (KJS merge)
2847         http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
2848
2849         * tests/mozilla/expected.html: Updated for newly fixed test.
2850
2851         * kjs/array_object.cpp:
2852         (ArrayProtoFunc::ArrayProtoFunc):
2853         * kjs/array_object.h:
2854         * kjs/bool_object.cpp:
2855         (BooleanPrototype::BooleanPrototype):
2856         (BooleanProtoFunc::BooleanProtoFunc):
2857         * kjs/bool_object.h:
2858         * kjs/date_object.cpp:
2859         (KJS::DateProtoFunc::DateProtoFunc):
2860         (KJS::DateObjectImp::DateObjectImp):
2861         (KJS::DateObjectFuncImp::DateObjectFuncImp):
2862         * kjs/error_object.cpp:
2863         (ErrorPrototype::ErrorPrototype):
2864         (ErrorProtoFunc::ErrorProtoFunc):
2865         * kjs/error_object.h:
2866         * kjs/function.cpp:
2867         (KJS::FunctionImp::FunctionImp):
2868         (KJS::GlobalFuncImp::GlobalFuncImp):
2869         * kjs/function.h:
2870         * kjs/function_object.cpp:
2871         (FunctionPrototype::FunctionPrototype):
2872         (FunctionProtoFunc::FunctionProtoFunc):
2873         (FunctionProtoFunc::callAsFunction):
2874         * kjs/function_object.h:
2875         * kjs/internal.cpp:
2876         (KJS::InterpreterImp::initGlobalObject):
2877         (KJS::InternalFunctionImp::InternalFunctionImp):
2878         * kjs/internal.h:
2879         (KJS::InternalFunctionImp::functionName):
2880         * kjs/lookup.h:
2881         (KJS::staticFunctionGetter):
2882         (KJS::HashEntryFunction::HashEntryFunction):
2883         (KJS::HashEntryFunction::implementsCall):
2884         (KJS::HashEntryFunction::toBoolean):
2885         (KJS::HashEntryFunction::implementsHasInstance):
2886         (KJS::HashEntryFunction::hasInstance):
2887         * kjs/math_object.cpp:
2888         (MathFuncImp::MathFuncImp):
2889         * kjs/math_object.h:
2890         * kjs/number_object.cpp:
2891         (NumberPrototype::NumberPrototype):
2892         (NumberProtoFunc::NumberProtoFunc):
2893         * kjs/number_object.h:
2894         * kjs/object.cpp:
2895         (KJS::JSObject::putDirectFunction):
2896         (KJS::Error::create):
2897         * kjs/object.h:
2898         * kjs/object_object.cpp:
2899         (ObjectPrototype::ObjectPrototype):
2900         (ObjectProtoFunc::ObjectProtoFunc):
2901         * kjs/object_object.h:
2902         * kjs/regexp_object.cpp:
2903         (RegExpPrototype::RegExpPrototype):
2904         (RegExpProtoFunc::RegExpProtoFunc):
2905         * kjs/regexp_object.h:
2906         * kjs/string_object.cpp:
2907         (StringProtoFunc::StringProtoFunc):
2908         (StringObjectImp::StringObjectImp):
2909         (StringObjectFuncImp::StringObjectFuncImp):
2910         * kjs/string_object.h:
2911         
2912 2006-02-20  Geoffrey Garen  <ggaren@apple.com>
2913
2914         Reviewed by Darin, with help from Eric, Maciej.
2915
2916         - More changes to support super-accurate JS iBench. Doesn't work on 
2917         Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
2918         opendarwin.org/show_bug.cgi?id= 7399] about that. 
2919
2920         * kjs/interpreter.cpp:
2921         (KJS::Interpreter::evaluate): Print line numbers with exception output
2922         * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the 
2923         way we roll with .cpp files.
2924         (StopWatch::StopWatch): New class. Provides microsecond-accurate 
2925         timings.
2926         (StopWatch::~StopWatch):
2927         (StopWatch::start):
2928         (StopWatch::stop):
2929         (StopWatch::getElapsedMS):
2930         (TestFunctionImp::callAsFunction): Added missing return statement. 
2931         Fixed up "run" to use refactored helper functions. Removed bogus 
2932         return statement from "quit" case. Made "print" output to stdout 
2933         instead of stderr because that makes more sense, and PERL handles 
2934         stdout better.
2935         (main): Factored out KXMLCore unit tests. Removed custom exception 
2936         printing code because the interpreter prints exceptions for you. Added 
2937         a "delete" call for the GlobalImp we allocate.
2938         (testIsInteger): New function, result of refacotring.
2939         (createStringWithContentsOfFile): New function, result of refactoring. 
2940         Renamed "code" to "buffer" to match factored-out-ness.
2941
2942 2006-02-20  Eric Seidel  <eseidel@apple.com>
2943
2944         Reviewed by hyatt.
2945
2946         Fix "Copy ICU DLLs..." phase.
2947
2948         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2949         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2950
2951 2006-02-19  Darin Adler  <darin@apple.com>
2952
2953         - renamed ERROR to LOG_ERROR to fix build
2954           presumably Maciej had this change and forgot to land it
2955
2956         * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
2957         * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
2958         * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
2959
2960 2006-02-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2961
2962         Test: fast/js/toString-exception.html
2963
2964         Reviewed by Maciej.
2965
2966         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
2967           REGRESSION: fast/js/toString-overrides.html fails when run multiple times
2968
2969         * kjs/array_object.cpp:
2970         (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
2971         returning an error.
2972
2973 2006-02-18  Darin Adler  <darin@apple.com>
2974
2975         Reviewed by Maciej.
2976
2977         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
2978           add insert and remove to KXMLCore::Vector
2979
2980         * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
2981         insert and remove to slide elements within the vector. Also added
2982         "insert" and "remove" functions.
2983
2984 2006-02-16  Geoffrey Garen  <ggaren@apple.com>
2985
2986         Reviewed by John.
2987
2988         - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
2989         Bindings::Instance::deref when leaving page @ gigaom.com
2990
2991         * bindings/c/c_instance.cpp:
2992         (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
2993         globally, we shouldn't delete it, so don't.
2994
2995 2006-02-16  Timothy Hatcher  <timothy@apple.com>
2996
2997         Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
2998         warnings. Using <rdar://problem/4448350> to track this.
2999
3000         * JavaScriptCore.xcodeproj/project.pbxproj:
3001         * bindings/objc/objc_jsobject.h: Removed empty file.
3002         * bindings/objc/objc_jsobject.mm: Removed empty file.
3003
3004 2006-02-16  Tim Omernick  <timo@apple.com>
3005
3006         Reviewed by Geoff.
3007
3008         <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
3009         javascript disabled (7015)
3010
3011         * bindings/NP_jsobject.cpp:
3012         (_NPN_CreateNoScriptObject):
3013         Returns an NPObject which is not bound to a JavaScript object.  This kind of NPObject
3014         can be given to a plugin as the "window script object" when JavaScript is disabled.
3015         The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
3016         Because of this, none of the NPN_* functions called by the plugin on this "no script
3017         object" will cause entry into JavaScript code.
3018         (_NPN_InvokeDefault):
3019         Make sure the NPVariant is filled before returning from this function.  This never
3020         mattered before because we never reached this case, having only created NPObjects of
3021         the class NPScriptObjectClass.
3022         (_NPN_Invoke):
3023         ditto
3024         (_NPN_Evaluate):
3025         ditto
3026         (_NPN_GetProperty):
3027         ditto
3028
3029         * bindings/NP_jsobject.h:
3030         Declared _NPN_CreateNoScriptObject().
3031
3032 2006-02-16  Darin Adler  <darin@apple.com>
3033
3034         Reviewed by me, change by Peter Kuemmel.
3035
3036         * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
3037         checking for positive infinity (rolling in fix from KDE side).
3038
3039 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
3040
3041         Reviewed by Maciej, Eric.
3042
3043         - JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
3044         crashes in DashboardClient at com.apple.JavaScriptCore:
3045         KJS::Bindings::ObjcFallbackObjectImp::type()
3046
3047         WebCore and JavaScriptCore weren't sharing Instance objects very
3048         nicely. I made them use RefPtrs, and sent them to bed without dessert.
3049
3050         * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
3051         (JavaInstance::~JavaInstance):
3052         (JObjectWrapper::JObjectWrapper):
3053         * bindings/jni/jni_instance.h:
3054         (KJS::Bindings::JObjectWrapper::ref):
3055         (KJS::Bindings::JObjectWrapper::deref):
3056         * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
3057         (JavaArray::~JavaArray):
3058         (JavaArray::JavaArray):
3059         * bindings/jni/jni_runtime.h:
3060         (KJS::Bindings::JavaArray::operator=):
3061         * bindings/objc/objc_runtime.h:
3062         - Prohibited copying because that would muss the ref count.
3063         - Prohibited construction without instance because an instance wrapper
3064         without an instance is almost certainly a bug.
3065         * bindings/objc/objc_runtime.mm:
3066         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3067         * bindings/runtime.cpp:
3068         (KJS::Bindings::Instance::Instance):
3069         (KJS::Bindings::Instance::createBindingForLanguageInstance):
3070         (KJS::Bindings::Instance::createRuntimeObject):
3071         * bindings/runtime.h:
3072         (KJS::Bindings::Instance::ref):
3073         (KJS::Bindings::Instance::deref):
3074         * bindings/runtime_object.cpp:
3075         (RuntimeObjectImp::RuntimeObjectImp):
3076         (RuntimeObjectImp::fallbackObjectGetter):
3077         (RuntimeObjectImp::fieldGetter):
3078         (RuntimeObjectImp::methodGetter):
3079         (RuntimeObjectImp::getOwnPropertySlot):
3080         (RuntimeObjectImp::put):
3081         (RuntimeObjectImp::canPut):
3082         * bindings/runtime_object.h: 
3083         - Removed ownsInstance data member because RefPtr takes care of 
3084         instance lifetime now. 
3085         - Prohibited copying because that would muss the ref count.
3086         - Prohibited construction without instance because an instance wrapper
3087         without an instance is almost certainly a bug.
3088         (KJS::RuntimeObjectImp::getInternalInstance):
3089
3090 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
3091
3092         Reviewed by John.
3093
3094         - Applied the 4330457 change to CClass and ObjcClass as well.
3095
3096         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
3097         will catch this. 
3098
3099         This change isn't as critical because CClass and ObjcClass objects get 
3100         cached globally and never deleted, but it's good practice, in case we 
3101         ever do decide to delete CClass and ObjcClass objects.
3102
3103         This change requires prohibiting copying, because we don't do any 
3104         intelligent ref-counting -- when a Class is destroyed, it destroys its 
3105         methods and fields unconditionally. (Java classes already prohibited
3106         copying.)
3107
3108         * bindings/c/c_class.cpp:
3109         - Merged _commonInit and _commonDelete into constructor and destructor.
3110         (CClass::CClass):
3111         (CClass::~CClass):
3112         (CClass::methodsNamed): Added delete callbacks
3113         (CClass::fieldNamed): Added delete callbacks
3114         * bindings/c/c_class.h: Prohibited copying
3115         * bindings/c/c_instance.cpp: 
3116         (KJS::Bindings::CInstance::getClass): Changed to use the preferred 
3117         class factory method, to take advantage of the global cache.
3118
3119         [ Repeated changes applied to CClass for ObjcClass: ]
3120
3121         * bindings/objc/objc_class.h: 
3122         * bindings/objc/objc_class.mm:
3123         (KJS::Bindings::ObjcClass::ObjcClass):
3124         (KJS::Bindings::ObjcClass::~ObjcClass):
3125         (KJS::Bindings::ObjcClass::methodsNamed):
3126         (KJS::Bindings::ObjcClass::fieldNamed):
3127         * bindings/objc/objc_runtime.h:
3128         (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
3129         variable to prevent bad CFRelease.
3130         (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
3131         if statement to prevent bad CFRelease.
3132         * bindings/objc/objc_runtime.cpp: Changed to use the preferred
3133         ObjectStructPtr, for clarity.
3134
3135 2006-02-14  Geoffrey Garen  <ggaren@apple.com>
3136
3137         Reviewed by John.
3138
3139         - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
3140         in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
3141         getClass const + 56
3142
3143         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
3144         will catch this. 
3145
3146         This was a memory leak in the bindings code. The leak was so extreme
3147         that it would cause Safari or the JVM to abort from lack of memory.
3148         Upon construction, Class objects create field and method objects, 
3149         storing them in CFDictionaries. The bug was that upon destruction, the 
3150         class objects released the dictionaries but didn't destroy the stored 
3151         objects.
3152
3153         The fix is to supply CFDictionary callbacks for destroying the values
3154         added to the dictionary. 
3155         
3156         * bindings/jni/jni_class.cpp: 
3157         (JavaClass::JavaClass): Added delete callbacks
3158         * bindings/runtime.cpp: Added definitions for delete callbacks
3159         (KJS::Bindings::deleteMethodList):
3160         (KJS::Bindings::deleteMethod):
3161         (KJS::Bindings::deleteField):
3162         * bindings/runtime.h: Added declarations for delete callbacks
3163
3164 2006-02-14  Timothy Hatcher  <timothy@apple.com>
3165
3166         Reviewed by Justin.
3167
3168         Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
3169         behavior due to POSIX version of sh
3170
3171         * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
3172
3173 2006-02-13   Dave Hyatt <hyatt@apple.com>
3174
3175         Fix Win32 bustage in JavaScriptCore.
3176
3177         Reviewed by darin
3178
3179         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3180         Add JSImmediate to the Win32 project.
3181
3182         * kjs/JSImmediate.h:
3183         (KJS::JSImmediate::fromDouble):
3184         (KJS::JSImmediate::toDouble):
3185         (KJS::JSImmediate::NanAsBits):
3186         (KJS::JSImmediate::oneAsBits):
3187         Win32 needs explicit returns after abort() for non-void functions.
3188
3189         * kjs/testkjs.cpp:
3190         (run):
3191         Win32 catches a bug in testkjs!  The "return 2" should actually
3192         have been a return false.
3193
3194         * kjs/value.h:
3195         The extern decls of NaN and Inf need to be const.
3196
3197 === JavaScriptCore-521.7 ===
3198
3199 2006-02-13  Timothy Hatcher  <timothy@apple.com>
3200
3201         Reviewed by Darin.
3202
3203         Replaced the old NS_DURING exception blocking with @try/@catch.
3204
3205         * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
3206         * bindings/objc/objc_instance.mm:
3207         (ObjcInstance::invokeMethod):
3208         (ObjcInstance::invokeDefaultMethod):
3209         (ObjcInstance::setValueOfUndefinedField):
3210         (ObjcInstance::getValueOfUndefinedField):
3211         * bindings/objc/objc_runtime.mm:
3212         (ObjcField::valueFromInstance):
3213         (ObjcField::setValueToInstance):
3214         (ObjcArray::setValueAt):
3215         (ObjcArray::valueAt):
3216
3217 2006-02-13  Darin Adler  <darin@apple.com>
3218
3219         - fix a couple problems building on Windows, based on requests
3220           from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3221
3222         * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
3223         to the standard uint32/64_t. Also removed curious "isIEEE()" function
3224         that checked the sizes of some types (and type sizes alone don't tell you if
3225         the floating point conforms to the IEEE-standard). Added missing include
3226         of <stdint.h>.
3227
3228         * kjs/property_slot.h: Added missing include of <assert.h>.
3229
3230 2006-02-12  Geoffrey Garen  <ggaren@apple.com>
3231
3232         Reviewed by darin.
3233
3234         Cleaned up testkjs, added new "run" functionality to allow scripting 
3235         tests from within JS. ("run" is a part of my new super-accurate
3236         JS iBench.)
3237
3238         No regressions in run-javascriptcore-tests.
3239
3240         * kjs/testkjs.cpp:
3241         (GlobalImp::className):
3242         (TestFunctionImp::):
3243         (TestFunctionImp::callAsFunction):
3244         (main):
3245         (run):
3246
3247 2006-02-11  Alexey Proskuryakov  <ap@nypop.com>
3248
3249         Reviewed by Darin.
3250
3251         - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
3252         RealPlayer.GetTitle() Crashes Safari/Dashboard
3253
3254         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
3255         Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1, 
3256         because the latter encoding has holes, and conversion can still fail.
3257
3258 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
3259
3260         Reviewed by Darin.
3261
3262         - Inlined RefPtr assignment operators. .7% performance win on 
3263         super-accurate JS iBench.
3264
3265         * kxmlcore/RefPtr.h:
3266         (KXMLCore::::operator):
3267
3268 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
3269
3270         No review needed, just a build fix. This time for sure.
3271
3272         * kjs/JSType.h:
3273
3274 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
3275
3276         Reviewed by eric.
3277         
3278         - Fixed build. As it goes without saying, I will not mention that I
3279         blame Kevin.
3280
3281         * JavaScriptCore.xcodeproj/project.pbxproj:
3282         * kjs/JSImmediate.cpp:
3283         (KJS::JSImmediate::toObject):
3284
3285 2006-02-09  Geoffrey Garen  <ggaren@apple.com>
3286
3287         Reviewed by mjs.
3288
3289         - Fixed <rdar://problem/4343730> Should switch ConstantValues (null, 
3290         undefined, true, false) from JS objects to immediate values similar to
3291         SimpleNumber
3292
3293         2.0% performance gain on my new super-accurate version of JS iBench.
3294         (I promise to land a version of it soon.)
3295
3296         The gist of the change:
3297         (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
3298         class (JSImmediate.h/.cpp), and it handles not only numbers but also 
3299         null, undefined, true, and false. 
3300         (2) JSImmediate provides convenience methods for the bit masking
3301         necessary to encode and decode immediate values.
3302         (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
3303         (4) JSCell no longer implements functions like getBoolean, because
3304         only a JSImmediate can be a boolean.
3305         (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
3306         and ALWAYS_INLINE is a non-portable option of last resort.
3307         (6) Type is now JSType, and it resides in its own file, JSType.h.
3308         Since I was there, I did some header include sorting as part of this
3309         change.
3310
3311         The rest pretty much explains itself.
3312
3313         * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
3314         added JSImmediate.h/.cpp.
3315         * bindings/c/c_instance.cpp:
3316         (KJS::Bindings::CInstance::defaultValue):
3317         * bindings/c/c_instance.h:
3318         * bindings/c/c_utility.cpp:
3319         (KJS::Bindings::convertValueToNPVariant):
3320         * bindings/jni/jni_instance.cpp:
3321         (JavaInstance::defaultValue):
3322         * bindings/jni/jni_instance.h:
3323         * bindings/jni/jni_jsobject.cpp:
3324         (JavaJSObject::convertValueToJObject):
3325         * bindings/objc/WebScriptObject.mm:
3326         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
3327         Standardized calls to use getXXX instead of hand-rolling JSValue 
3328         functionality.
3329         * bindings/objc/objc_instance.h:
3330         * bindings/objc/objc_instance.mm:
3331         (ObjcInstance::getValueOfUndefinedField):
3332         (ObjcInstance::defaultValue):
3333         * bindings/objc/objc_runtime.h:
3334         * bindings/objc/objc_runtime.mm:
3335         (ObjcFallbackObjectImp::type):
3336         (ObjcFallbackObjectImp::defaultValue):
3337         * bindings/runtime.h:
3338         (KJS::Bindings::Instance::getValueOfUndefinedField):
3339         * bindings/runtime_object.cpp:
3340         (RuntimeObjectImp::defaultValue):
3341         * bindings/runtime_object.h:
3342         * kjs/JSImmediate.h: Added.
3343         (KJS::JSImmediate::isImmediate):
3344         (KJS::JSImmediate::isNumber):
3345         (KJS::JSImmediate::isBoolean):
3346         (KJS::JSImmediate::isUndefinedOrNull):
3347         (KJS::JSImmediate::fromDouble):
3348         (KJS::JSImmediate::toDouble):
3349         (KJS::JSImmediate::toBoolean):
3350         (KJS::JSImmediate::trueImmediate):
3351         (KJS::JSImmediate::falseImmediate):
3352         (KJS::JSImmediate::NaNImmediate):
3353         (KJS::JSImmediate::undefinedImmediate):
3354         (KJS::JSImmediate::nullImmediate):
3355         (KJS::JSImmediate::tag):
3356         (KJS::JSImmediate::unTag):
3357         (KJS::JSImmediate::getTag):
3358         (KJS::JSImmediate::):
3359         (KJS::JSImmediate::isIEEE):
3360         (KJS::JSImmediate::is32bit):
3361         (KJS::JSImmediate::is64bit):
3362         (KJS::JSImmediate::NanAsBits):
3363         (KJS::JSImmediate::zeroAsBits):
3364         (KJS::JSImmediate::oneAsBits):
3365         * kjs/JSLock.cpp:
3366         (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
3367         * kjs/JSType.h: Added.
3368         * kjs/collector.cpp:
3369         (KJS::Collector::protect):
3370         (KJS::Collector::unprotect):
3371         (KJS::Collector::collect):
3372         * kjs/internal.cpp:
3373         (KJS::StringImp::toPrimitive):
3374         (KJS::NumberImp::toPrimitive):
3375         (KJS::NumberImp::toBoolean):
3376         (KJS::GetterSetterImp::toPrimitive):
3377         * kjs/internal.h:
3378         (KJS::StringImp::type):
3379         (KJS::NumberImp::type):
3380         * kjs/object.cpp:
3381         (KJS::JSObject::type):
3382         (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
3383         I'm looking for?" test with "Are you not the one thing I'm not looking
3384         for" test.
3385         (KJS::JSObject::defaultValue):
3386         (KJS::JSObject::toPrimitive):
3387         * kjs/object.h:
3388         (KJS::GetterSetterImp::type):
3389         (KJS::JSValue::isObject):
3390         * kjs/operations.cpp:
3391         (KJS::equal):
3392         (KJS::strictEqual):
3393         (KJS::add):
3394         * kjs/reference.cpp:
3395         (KJS::Reference::deleteValue):
3396         * kjs/simple_number.h: Removed.
3397         * kjs/string_object.cpp:
3398         (StringInstance::getOwnPropertySlot): fixed indentation
3399         * kjs/value.cpp:
3400         (KJS::JSValue::toObject):
3401         (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
3402         us to inline jsNumber without adding PIC branches to callers.
3403         * kjs/value.h:
3404         (KJS::jsUndefined):
3405         (KJS::jsNull):
3406         (KJS::jsNaN):
3407         (KJS::jsBoolean):
3408         (KJS::jsNumber):
3409         (KJS::JSValue::downcast):
3410         (KJS::JSValue::isUndefinedOrNull):
3411         (KJS::JSValue::isBoolean):
3412         (KJS::JSValue::isNumber):
3413         (KJS::JSValue::isString):
3414         (KJS::JSValue::isObject):
3415         (KJS::JSValue::getBoolean):
3416         (KJS::JSValue::getNumber):
3417         (KJS::JSValue::getString):
3418         (KJS::JSValue::getObject):
3419         (KJS::JSValue::getUInt32):
3420         (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
3421         resulting in a slight performance gain. Callers should always check
3422         !marked() before calling mark(), so it's impossible to call mark on
3423         a JSImmediate.
3424         (KJS::JSValue::marked):
3425         (KJS::JSValue::type):
3426         (KJS::JSValue::toPrimitive):
3427         (KJS::JSValue::toBoolean):
3428         (KJS::JSValue::toNumber):
3429         (KJS::JSValue::toString):
3430
3431 2006-02-06  Eric Seidel  <eseidel@apple.com>
3432
3433         Add svn:ignore properties for visual studio internals.
3434
3435 2006-02-06  Alexey Proskuryakov  <ap@nypop.com>
3436
3437         Reviewed by Darin.
3438
3439         - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
3440         http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
3441
3442         - No tests added - only changed functionality on WIN32, which should be covered by 
3443         existing tests.
3444
3445         * kjs/date_object.cpp:
3446         (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
3447         Updated comments. 
3448         (KJS::timeZoneOffset): Removed, was basically the same as the above.
3449         (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
3450         Windows based on struct tm itself.
3451         (KJS::DateInstance::getTime): Added.
3452         (KJS::DateInstance::getUTCTime): Added.
3453         (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
3454         (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
3455         (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
3456         GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
3457         with daylight savings time being in effect.
3458
3459         * kjs/date_object.h: Added prototypes for new functions.
3460
3461 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
3462
3463         Reviewed by Anders.
3464         
3465         - fixed ~1100 KJS::Node leaked on layout tests
3466         http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
3467
3468         * kjs/internal.cpp:
3469         (KJS::Parser::noteNodeCycle):
3470         (KJS::Parser::removeNodeCycle):
3471         (KJS::clearNewNodes):
3472         * kjs/internal.h:
3473         * kjs/nodes.cpp:
3474         (ElementNode::breakCycle):
3475         (PropertyListNode::breakCycle):
3476         (ArgumentListNode::breakCycle):
3477         (StatListNode::StatListNode):
3478         (StatListNode::breakCycle):
3479         (VarDeclListNode::breakCycle):
3480         (BlockNode::BlockNode):
3481         (ClauseListNode::breakCycle):
3482         (CaseBlockNode::CaseBlockNode):
3483         (ParameterNode::breakCycle):
3484         (SourceElementsNode::SourceElementsNode):
3485         (SourceElementsNode::breakCycle):
3486         * kjs/nodes.h:
3487         (KJS::Node::breakCycle):
3488         (KJS::ElementNode::ElementNode):
3489         (KJS::ArrayNode::ArrayNode):
3490         (KJS::PropertyListNode::PropertyListNode):
3491         (KJS::ObjectLiteralNode::ObjectLiteralNode):
3492         (KJS::ArgumentListNode::ArgumentListNode):
3493         (KJS::ArgumentsNode::ArgumentsNode):
3494         (KJS::VarDeclListNode::VarDeclListNode):
3495         (KJS::VarStatementNode::VarStatementNode):
3496         (KJS::ForNode::ForNode):
3497         (KJS::CaseClauseNode::CaseClauseNode):
3498         (KJS::ClauseListNode::ClauseListNode):
3499         (KJS::ParameterNode::ParameterNode):
3500         (KJS::FuncExprNode::FuncExprNode):
3501         (KJS::FuncDeclNode::FuncDeclNode):
3502
3503 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
3504
3505         Reviewed by Hyatt.
3506         
3507         - fix default traits for classes to make sure default constructors get called
3508
3509         * kxmlcore/VectorTraits.h:
3510         (KXMLCore::):
3511
3512 2006-02-04  Darin Adler  <darin@apple.com>
3513
3514         Reviewed by Maciej.
3515
3516         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
3517           REGRESSION: for/in loop with var changes global variable instead of making local
3518
3519         Test: fast/js/for-in-var-scope.html
3520
3521         * kjs/nodes.cpp:
3522         (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
3523         (ForInNode::execute): Break out of the scope chain loop once we find and set the
3524         loop variable. We don't want to set multiple loop variables.
3525         (ForInNode::processVarDecls): Process the declaration of the loop variable.
3526
3527         - other cleanup
3528
3529         * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
3530         * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
3531         instead of defining it here a second time.
3532
3533 2006-02-04  Maciej Stachowiak  <mjs@apple.com>
3534
3535         Reviewed by Hyatt.
3536         
3537         - change JavaScript collector statistics calls to use HashCountedSet instead
3538         of CFSet; other misc cleanup
3539         http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
3540         
3541         * kjs/collector.cpp:
3542         (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
3543         (KJS::typeName):
3544         (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
3545         use HashSet
3546         * kjs/collector.h:
3547         (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
3548         * kjs/nodes.cpp:
3549
3550 2006-02-03  Timothy Hatcher  <timothy@apple.com>
3551
3552         Reviewed by Justin.
3553
3554         Renamed configuration names to Debug, Release and Production.
3555
3556         * JavaScriptCore.xcodeproj/project.pbxproj:
3557
3558 2006-02-02  George Staikos <staikos@opensource.apple.com>
3559
3560         Reviewed by Maciej.
3561
3562         * kjs/lookup.h: Fix compile, merged from KDE.
3563
3564 2006-02-02  Darin Adler  <darin@apple.com>
3565
3566         Reviewed by Maciej.
3567
3568         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
3569           add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
3570
3571         * kxmlcore/Noncopyable.h: Added.
3572         * kxmlcore/OwnArrayPtr.h: Added.
3573         * kxmlcore/OwnPtr.h: Added.
3574
3575         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
3576
3577         * kjs/function.h:
3578         * kjs/function.cpp: Use OwnPtr for Parameter pointers.
3579
3580         * kjs/internal.h: Use Noncopyable for LabelStack.
3581
3582         * kjs/list.cpp: Use OwnArrayPtr for overflow.
3583
3584         * kjs/property_map.h:
3585         * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
3586         Use Vector for some stack buffers.
3587
3588         * kjs/regexp_object.h:
3589         * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
3590
3591 2006-01-31  Maciej Stachowiak  <mjs@apple.com>
3592
3593         Reviewed by Darin.
3594         
3595         - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
3596         that would catch them
3597
3598         * kjs/nodes.cpp:
3599         (NodeCounter::~NodeCounter): Added debug-only node counter.
3600         (Node::Node):
3601         (Node::~Node):
3602         * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
3603
3604 2006-01-31  Darin Adler  <darin@apple.com>
3605
3606         Reviewed by Maciej.
3607
3608         - added deleteAllValues for HashSet as well as HashMap
3609         - fixed conversion from const_iterator to iterator, which I broke a while back
3610
3611         * kxmlcore/HashMap.h: Updated copyright date.
3612         * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
3613         * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
3614
3615 2006-01-31  Tim Omernick  <timo@apple.com>
3616
3617         Reviewed by Geoff Garen.
3618
3619         * bindings/c/c_utility.cpp:
3620         (KJS::Bindings::convertUTF8ToUTF16):
3621         Fixed an invalid assertion that UTF8Chars is not NULL.  It is valid for it to be NULL as long as
3622         UTF8Length is 0.
3623         This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
3624         where JavaScript is getting a NULL string back from some call on the Real Player plugin.
3625
3626 2006-01-30  Anders Carlsson  <andersca@mac.com>
3627
3628         Reviewed by Darin.
3629
3630         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
3631         REGRESSION: United.com menus messed up due to document.all/MSIE sniff
3632         
3633         * kjs/nodes.cpp:
3634         (typeStringForValue):
3635         Return "undefined" if the given object should masquerade as undefined.
3636         
3637         * kjs/object.h:
3638         (KJS::JSObject::masqueradeAsUndefined):
3639         Rename from isEqualToNull.
3640         
3641         * kjs/operations.cpp:
3642         (KJS::equal):
3643         Update for name change.
3644
3645 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
3646
3647         Reviewed by Darin.
3648         
3649         - properly define Vector assignment operator; the private version was accidentally left
3650         in, and the template version is not enough to replace the default
3651
3652         * kxmlcore/Vector.h:
3653         (KXMLCore::Vector::operator=):
3654
3655 2006-01-29  Eric Seidel  <eseidel@apple.com>
3656
3657         Reviewed by darin.
3658
3659         Fix the build by applying a GCC-specific namespace hack.
3660
3661         * kjs/lookup.h:
3662
3663 2006-01-29  Eric Seidel <eseidel@apple.com>
3664
3665         Reviewed by hyatt.
3666
3667         Fix build on Win32.
3668
3669         * kjs/lookup.h: fixed ::cacheGlobalObject
3670         * kxmlcore/Vector.h:
3671         (KXMLCore::Vector::operator[]): use unsigned long
3672
3673 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
3674
3675         Reviewed by Dave Hyatt.
3676
3677         * kxmlcore/Vector.h:
3678         (KXMLCore::Vector::operator[]): Add unsigned overload
3679
3680 2006-01-28  Darin Adler  <darin@apple.com>
3681
3682         Reviewed by John Sullivan.
3683
3684         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
3685           include exception names in JavaScript form of DOM exception
3686
3687         * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
3688         exception in the error message.
3689
3690 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
3691
3692         Reviewed by Darin.
3693         
3694         - miscellaneous Vector improvements
3695
3696         * kxmlcore/Vector.h:
3697         (KXMLCore::Vector::at): Add range-checking asserts.
3698         (KXMLCore::Vector::first): Added as a convenience.
3699         (KXMLCore::Vector::last): Convenience for stack-style use.
3700         (KXMLCore::Vector::removeLast): ditto
3701
3702 2006-01-28  Darin Adler  <darin@apple.com>
3703
3704         Reviewed by John Sullivan
3705
3706         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
3707           REGRESSION: JavaScript Date constructor won't accept another Date object
3708
3709         Test: fast/js/date-constructor.html
3710
3711         * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
3712         Added a special case for constructing one date from another (to avoid losing
3713         milliseconds, which are not in the text form, to match Firefox), and changed
3714         the base code to convert to primitive before checking for string to match
3715         the standard. Also corrected a couple silly things in the "construct from
3716         current time" code path (removed a floor that does no good, and changed
3717         the constant used to convert microseconds to milliseconds to be a 1000
3718         rather than "msPerSecond").
3719
3720 2006-01-28  Darin Adler  <darin@apple.com>
3721
3722         * kjs/create_hash_table: Added missing license.
3723
3724 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
3725
3726         Reviewed by Dave Hyatt.
3727         
3728         - added a Vector class
3729         http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
3730
3731         * JavaScriptCore.xcodeproj/project.pbxproj:
3732         * kjs/internal.cpp:
3733         (KJS::Parser::saveNewNode): Apply Vector.
3734         (KJS::clearNewNodes): ditto
3735         * kjs/number_object.cpp:
3736         (integer_part_noexp): ditto
3737         (char_sequence): ditto
3738         * kjs/ustring.cpp:
3739         (KJS::UString::UTF8String): ditto
3740         * kxmlcore/HashMap.h:
3741         (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
3742         other versions are useful for other containers.
3743         * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
3744         be usable for all Array/QVector style purposes, and also as a stack buffer
3745         with oversize handling. Also some helper classes to make vector operations
3746         as efficient as possible for POD types and for simple non-PODs like RefPtr.
3747         (KXMLCore::):
3748         (KXMLCore::VectorTypeOperations::destruct):
3749         (KXMLCore::VectorTypeOperations::initialize):
3750         (KXMLCore::VectorTypeOperations::move):
3751         (KXMLCore::VectorTypeOperations::uninitializedCopy):
3752         (KXMLCore::VectorTypeOperations::uninitializedFill):
3753         (KXMLCore::VectorBuffer::VectorBuffer):
3754         (KXMLCore::VectorBuffer::~VectorBuffer):
3755         (KXMLCore::VectorBuffer::deallocateBuffer):
3756         (KXMLCore::VectorBuffer::inlineBuffer):
3757         (KXMLCore::Vector::Vector):
3758         (KXMLCore::Vector::~Vector):
3759         (KXMLCore::Vector::size):
3760         (KXMLCore::Vector::capacity):
3761         (KXMLCore::Vector::isEmpty):
3762         (KXMLCore::Vector::at):
3763         (KXMLCore::Vector::operator[]):
3764         (KXMLCore::Vector::data):
3765         (KXMLCore::Vector::operator T*):
3766         (KXMLCore::Vector::operator const T*):
3767         (KXMLCore::Vector::begin):
3768         (KXMLCore::Vector::end):
3769         (KXMLCore::Vector::clear):
3770         (KXMLCore::Vector::fill):
3771         (KXMLCore::Vector::operator=):
3772         (KXMLCore::::Vector):
3773         (KXMLCore::::operator):
3774         (KXMLCore::::fill):
3775         (KXMLCore::::expandCapacity):
3776         (KXMLCore::::resize):
3777         (KXMLCore::::reserveCapacity):
3778         (KXMLCore::::append):
3779         (KXMLCore::deleteAllValues):
3780         * kxmlcore/VectorTraits.h: Added.
3781         (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
3782         simple types.
3783
3784 2006-01-28  Alexey Proskuryakov  <ap@nypop.com>
3785
3786         Reviewed by Darin.
3787
3788         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
3789         RealPlayer.GetTitle() Crashes Safari/Dashboard
3790
3791         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
3792         Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
3793
3794 2006-01-25  George Staikos <staikos@opensource.apple.com>
3795
3796         Reviewed by Darin.
3797
3798         * kxmlcore/HashFunctions.h: Merge build fix from KDE.
3799
3800 2006-01-25  Darin Adler  <darin@apple.com>
3801
3802         - removed an unused source file
3803
3804         * kjs/pointer_hash.h: Removed.
3805         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
3806
3807 2006-01-23  Anders Carlsson  <andersca@mac.com>
3808
3809         Reviewed by Maciej.
3810
3811         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
3812         KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
3813         
3814         * kjs/lookup.h:
3815         Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
3816         
3817         (cacheGlobalObject):
3818         Move this out of the KJS namespace.
3819
3820 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
3821
3822         Reviewed by Eric.
3823
3824         - renamed PointerHash to PtrHash
3825         - made PtrHash the default hash function for int and pointer types that aren't further specialized
3826         - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
3827         - did appropriate consequent cleanup (very few places now need to declare a hash function)
3828         http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
3829         
3830         * kjs/array_object.cpp:
3831         (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
3832         * kjs/collector.cpp: ditto
3833         * kjs/identifier.cpp:
3834         (KXMLCore::): declare DefaultHash the new way
3835         * kjs/internal.cpp: no need to mention PointerHash
3836         * kjs/ustring.h:
3837         * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
3838         easier to specialize on PtrHash
3839         * kxmlcore/HashFunctions.h:
3840         (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
3841         a Hash typedef rather than being a hash function class itself; declared DefaultHash
3842         for int and partializy specialized for pointer types
3843         * kxmlcore/HashMapPtrSpec.h:
3844         (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
3845         way of handling pointer hash
3846         (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
3847         (KXMLCore::): ditto
3848         * kxmlcore/HashMap.h: ditto
3849         * kxmlcore/HashSet.h: ditto
3850
3851 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
3852
3853         Reviewed by Tim Omernick.
3854         
3855         - use classes instead of free functions for extractors, this better matches how other
3856         things work and should avoid the need for hacky workarounds on other compilers
3857         http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
3858
3859         * kjs/array_object.cpp:
3860         * kjs/identifier.cpp:
3861         * kjs/internal.cpp:
3862         * kxmlcore/HashMap.h:
3863         (KXMLCore::PairFirstExtractor::extract):
3864         * kxmlcore/HashMapPtrSpec.h:
3865         (KXMLCore::):
3866         * kxmlcore/HashSet.h:
3867         (KXMLCore::IdentityExtractor::extract):
3868         * kxmlcore/HashTable.h:
3869         (KXMLCore::addIterator):
3870         (KXMLCore::removeIterator):
3871         (KXMLCore::HashTable::add):
3872         (KXMLCore::HashTable::isEmptyBucket):
3873         (KXMLCore::HashTable::isDeletedBucket):
3874         (KXMLCore::HashTable::HashTable):
3875         (KXMLCore::HashTable::lookup):
3876         (KXMLCore::HashTable::add):
3877         (KXMLCore::HashTable::reinsert):
3878         (KXMLCore::HashTable::find):
3879         (KXMLCore::HashTable::contains):
3880         (KXMLCore::HashTable::remove):
3881         (KXMLCore::HashTable::allocateTable):
3882         (KXMLCore::HashTable::deallocateTable):
3883         (KXMLCore::HashTable::expand):
3884         (KXMLCore::HashTable::rehash):
3885         (KXMLCore::HashTable::clear):
3886         (KXMLCore::HashTable::swap):
3887         (KXMLCore::HashTable::operator):
3888         (KXMLCore::HashTable::checkTableConsistency):
3889         (KXMLCore::HashTable::checkTableConsistencyExceptSize):
3890         (KXMLCore::HashTable::invalidateIterators):
3891
3892 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
3893
3894         Rubber stamped by Tim Hatcher.
3895         
3896         - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
3897         for consistency with HashMap
3898
3899         * kjs/array_object.cpp:
3900         (ArrayProtoFunc::callAsFunction):
3901         * kjs/collector.cpp:
3902         (KJS::Collector::protect):
3903         * kjs/identifier.cpp:
3904         (KJS::Identifier::add):
3905         * kxmlcore/HashCountedSet.h:
3906         (KXMLCore::::add):
3907         * kxmlcore/HashMap.h:
3908         (KXMLCore::::inlineAdd):
3909         * kxmlcore/HashSet.h:
3910         (KXMLCore::::add):
3911         * kxmlcore/HashTable.h:
3912         (KXMLCore::HashTable::add):
3913         (KXMLCore::::add):
3914         (KXMLCore::::HashTable):
3915
3916 2006-01-23  Justin Garcia  <justin.garcia@apple.com>
3917
3918         Reviewed by thatcher
3919         
3920         Turned on -O2 for B&I build.
3921
3922         * JavaScriptCore.xcodeproj/project.pbxproj:
3923
3924 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
3925
3926         Reviewed by Tim Hatcher.
3927         
3928         - it's "Franklin Street", not "Franklin Steet"
3929
3930         * kjs/array_instance.h:
3931         * kjs/array_object.cpp:
3932         * kjs/array_object.h:
3933         * kjs/bool_object.cpp:
3934         * kjs/bool_object.h:
3935         * kjs/collector.cpp:
3936         * kjs/collector.h:
3937         * kjs/completion.h:
3938         * kjs/context.h:
3939         * kjs/date_object.cpp:
3940         * kjs/date_object.h:
3941         * kjs/debugger.cpp:
3942         * kjs/debugger.h:
3943         * kjs/dtoa.h:
3944         * kjs/error_object.cpp:
3945         * kjs/error_object.h:
3946         * kjs/function.cpp:
3947         * kjs/function.h:
3948         * kjs/function_object.cpp:
3949         * kjs/function_object.h:
3950         * kjs/grammar.y:
3951         * kjs/identifier.cpp:
3952         * kjs/identifier.h:
3953         * kjs/internal.cpp:
3954         * kjs/internal.h:
3955         * kjs/interpreter.cpp:
3956         * kjs/interpreter.h:
3957         * kjs/lexer.cpp:
3958         * kjs/lexer.h:
3959         * kjs/list.cpp:
3960         * kjs/list.h:
3961         * kjs/lookup.cpp:
3962         * kjs/lookup.h:
3963         * kjs/math_object.cpp:
3964         * kjs/math_object.h:
3965         * kjs/nodes.cpp:
3966         * kjs/nodes.h:
3967         * kjs/nodes2string.cpp:
3968         * kjs/number_object.cpp:
3969         * kjs/number_object.h:
3970         * kjs/object.cpp:
3971         * kjs/object.h:
3972         * kjs/object_object.cpp:
3973         * kjs/object_object.h:
3974         * kjs/operations.cpp:
3975         * kjs/operations.h:
3976         * kjs/property_map.cpp:
3977         * kjs/property_map.h:
3978         * kjs/property_slot.cpp:
3979         * kjs/property_slot.h:
3980         * kjs/reference.cpp:
3981         * kjs/reference.h:
3982         * kjs/reference_list.cpp:
3983         * kjs/reference_list.h:
3984         * kjs/regexp.cpp:
3985         * kjs/regexp.h:
3986         * kjs/regexp_object.cpp:
3987         * kjs/regexp_object.h:
3988         * kjs/scope_chain.cpp:
3989         * kjs/scope_chain.h:
3990         * kjs/simple_number.h:
3991         * kjs/string_object.cpp:
3992         * kjs/string_object.h:
3993         * kjs/testkjs.cpp:
3994         * kjs/types.h:
3995         * kjs/ustring.cpp:
3996         * kjs/ustring.h:
3997         * kjs/value.cpp:
3998         * kjs/value.h:
3999         * kxmlcore/AlwaysInline.h:
4000         * kxmlcore/ListRefPtr.h:
4001         * kxmlcore/PassRefPtr.h:
4002         * kxmlcore/RefPtr.h:
4003
4004 2006-01-23  Darin Adler  <darin@apple.com>
4005
4006         Reviewed by John Sullivan.
4007
4008         - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
4009           REGRESSION: Crash in cloneChildNodes when clicking element
4010
4011         * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
4012         type by calling get() instead of going directly at m_ptr.
4013         * kxmlcore/RefPtr.h: Ditto.
4014
4015         - other changes
4016
4017         * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
4018         It's just a resorted list of keys in a dictionary.
4019
4020         * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
4021         in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
4022         routine" property we want to have on OS X.
4023
4024 2006-01-22  Maciej Stachowiak  <mjs@apple.com>
4025
4026         Reviewed by Darin.
4027
4028         - Set up Page class and invert Frame / WebCoreFrameBridge ownership
4029         http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
4030
4031         * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can 
4032         override it
4033
4034 2006-01-23  George Staikos <staikos@opensource.apple.com>
4035
4036         Reviewed by Maciej and Darin.
4037
4038         * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
4039         * kjs/interpreter.cpp: ditto
4040         * kjs/simple_number.h: Add assert.h and remove from config.h
4041         * kjs/array_object.cpp: Use relative paths for kxmlcore includes
4042         * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
4043
4044 2006-01-23  George Staikos <staikos@opensource.apple.com>
4045
4046         Reviewed by Maciej.
4047
4048         * kjs/config.h: unbreak preprocessor change
4049
4050 2006-01-23  George Staikos <staikos@opensource.apple.com>
4051
4052         Approved by Maciej and Darin.
4053
4054         * kjs/:
4055         * kxmlcore/:
4056              Update FSF address in license to make merging easier
4057
4058 2006-01-22  George Staikos <staikos@opensource.apple.com>
4059
4060         Reviewed by Maciej.
4061
4062         * kjs/collector.cpp: merge major speedup from KDE on Linux
4063                              patch by Maks Orlovich, bug #6145
4064                              Also unify cpu detection
4065         * kjs/config.h: define simpler CPU macros
4066
4067 2006-01-22  George Staikos <staikos@opensource.apple.com>
4068
4069         Reviewed by Maciej.
4070
4071         * kjs/collector.cpp: merge FreeBSD compile fix from KDE
4072                              -> requires build magic for use
4073
4074 2006-01-21  George Staikos <staikos@opensource.apple.com>
4075
4076         Reviewed by Maciej.
4077
4078         * kjs/nodes2string.cpp
4079         * kjs/operations.h
4080         * kjs/debugger.h
4081           Fix pedantic compile with some gcc versions (Merge from KDE)
4082
4083         * kjs/create_hash_table:
4084           Fix build with Perl 5.8.0 (Merge from KDE)
4085
4086 2006-01-18  Darin Adler  <darin@apple.com>
4087
4088         Reviewed by Hyatt.
4089
4090         - hash table fixes needed for my WebCore changes
4091
4092         * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
4093         Added a missing return statement.
4094
4095         * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
4096         can't instantiate with a 0 by using traits rather than ? : to select the default
4097         emtpy value of hash table keys.
4098
4099         - small cleanup of "runtime" code left over from recent JavaScript crash fix
4100
4101         * bindings/runtime_root.h:
4102         (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
4103         since it's now a ProtectedPtr.
4104         (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
4105         fact that _imp was 0 and replaced with use of ProtectedPtr.
4106         (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
4107
4108 2006-01-17  Darin Adler  <darin@apple.com>
4109
4110         Reviewed by Anders.
4111
4112         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
4113           add assertions to check correct use of hash table iterators
4114
4115         * kxmlcore/HashTable.h:
4116         (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
4117         maintained by the specified hash table.
4118         (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
4119         the list maintained by the hash table it's in.
4120         (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
4121         parameter, ignored when not debugging. Call addIterator.
4122         (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
4123         (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
4124         (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
4125         (KXMLCore::HashTableConstIterator::operator->): Ditto.
4126         (KXMLCore::HashTableConstIterator::operator++): Ditto.
4127         (KXMLCore::HashTableConstIterator::operator==): Ditto.
4128         (KXMLCore::HashTableConstIterator::operator!=): Ditto.
4129         (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
4130         pointer is not 0 and if there are two iterators that both point at the same table.
4131         (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
4132         as an implementation detail, to avoid having two separate iterator implementations.
4133         (KXMLCore::HashTableIterator::operator*): Ditto.
4134         (KXMLCore::HashTableIterator::operator->): Ditto.
4135         (KXMLCore::HashTableIterator::operator++): Ditto.
4136         (KXMLCore::HashTableIterator::operator==): Ditto.
4137         (KXMLCore::HashTableIterator::operator!=): Ditto.
4138         (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
4139         (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
4140         (KXMLCore::HashTable::makeIterator): Pass this pointer.
4141         (KXMLCore::HashTable::makeConstIterator): Ditto.
4142         (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
4143         entry point that modifies the hash table.
4144         (KXMLCore::HashTable::remove): Ditto.
4145         (KXMLCore::HashTable::clear): Ditto.
4146         (KXMLCore::HashTable::swap): Ditto.
4147         (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
4148         clears out the table, next, and previous pointers in all of them, and then clears
4149         the head so we have an empty list.