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