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