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