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