- make fast_malloc.h a private header, not project
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2005-04-14  Maciej Stachowiak  <mjs@apple.com>
2
3         - make fast_malloc.h a private header, not project
4
5         * JavaScriptCore.pbproj/project.pbxproj:
6
7 2005-04-12  Maciej Stachowiak  <mjs@apple.com>
8
9         Reviewed by Richard.
10
11         <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
12
13         - use custom single-threaded malloc for all non-GC JavaScriptCore
14         allocations, for a 9.1% speedup on JavaScript iBench
15         
16         * JavaScriptCore.pbproj/project.pbxproj:
17         * kjs/collector.cpp:
18         (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
19         (KJS::Collector::collect): And dlfree to free it.
20         * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
21         * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
22         macro to give a class custom operator new/delete
23         * kjs/identifier.cpp:
24         (KJS::Identifier::add): Use dlmalloc/dlfree.
25         * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
26         * kjs/property_map.cpp:
27         (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
28         (KJS::PropertyMap::rehash): ditto
29         * kjs/scope_chain.h:
30         * kjs/ustring.cpp:
31         (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
32         buffer, to hide allocation details from webcore.
33         (KJS::UString::UString): use createCopying when appropriate.
34         (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
35         (KJS::UString::expandedSize): likewise
36         (KJS::UString::expandCapacity): likewise
37         (KJS::UString::expandPreCapacity): likewise
38         (KJS::UString::spliceSubstringsWithSeparators): likewise
39         (KJS::UString::append): likewise
40         (KJS::UString::operator=): likewise
41         (KJS::UString::detach): likewise
42         * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
43
44 2005-04-11  Maciej Stachowiak  <mjs@apple.com>
45
46         Reviewed by John.
47
48         <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
49
50         - Avoid using protected values hash for the two most common cases
51         - Bump up ListImp high water mark, new testing shows 508 ListImps are
52         created during JS iBench.
53
54         Net result is a 5.6% speedup on JavaScript iBench
55         
56         * kjs/collector.cpp:
57         (KJS::Collector::collect): mark protected lists as appropriate.
58         * kjs/context.h:
59         * kjs/list.cpp:
60         (KJS::ListImp::markValues): Moved implementation from List::markValues
61         (KJS::List::markProtectedLists): Implemented - scan pool and overflow
62         list.
63         (KJS::allocateListImp): link lists outside the pool into a separate
64         doubly linked list to be able to mark protected lists
65         (KJS::deallocateListImp): do the corresponding delinking
66         (KJS::List::derefValues): do nothing in conservative GC mode
67         (KJS::List::refValues): do nothing in conservative GC mode
68         (KJS::List::markValues): call ListImp version
69         (KJS::List::append):
70         * kjs/list.h:
71
72 === Safari-412 ===
73
74 === Safari-411 ===
75
76 === Safari-410 ===
77
78 === Safari-409 ===
79
80 === Safari-408 ===
81
82 === Safari-407 ===
83
84 2005-03-16  Jens Alfke  <jens@apple.com>
85
86         Reviewed by Kevin.
87
88         Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
89         JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
90         In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
91         Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
92
93         * kjs/function.cpp:
94         (KJS::GlobalFuncImp::call):
95
96 2005-03-15  Richard Williamson   <rjw@apple.com>
97
98         Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
99
100         Added JavaScript boolean to type that can be converted to
101         ObjC scalar parameters.
102
103         Reviewed by Ken Kocienda.
104
105         * bindings/objc/objc_utility.mm:
106         (KJS::Bindings::convertValueToObjcValue):
107
108 === Safari-406 ===
109
110 === Safari-405 ===
111
112 === Safari-403 ===
113
114 === Safari-402 ===
115
116 === Safari-401 ===
117
118 === Safari-400 ===
119
120 === Safari-188 ===
121
122 2005-02-21  Darin Adler  <darin@apple.com>
123
124         * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
125
126 2005-02-17  Richard Williamson   <rjw@apple.com>
127
128         Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
129
130         Added nil check.
131
132         Reviewed by John Sullivan.
133
134         * bindings/jni/jni_runtime.cpp:
135         (JavaField::valueFromInstance):
136
137 === Safari-187 ===
138
139 2005-02-11  Richard Williamson   <rjw@apple.com>
140
141         Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
142
143         Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
144         creates these wrappers.  The WebCore subclass of the interpreter now overrides
145         createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
146
147         Reviewed by Ken.
148
149         * bindings/c/c_utility.cpp:
150         (convertValueToNPVariant):
151         * bindings/jni/jni_instance.cpp:
152         (JavaInstance::invokeMethod):
153         * bindings/jni/jni_objc.mm:
154         (KJS::Bindings::dispatchJNICall):
155         * bindings/jni/jni_runtime.cpp:
156         (JavaField::valueFromInstance):
157         (JavaArray::valueAt):
158         * bindings/objc/WebScriptObject.mm:
159         (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
160         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
161         * bindings/objc/WebScriptObjectPrivate.h:
162         * bindings/objc/objc_utility.h:
163         * bindings/objc/objc_utility.mm:
164         (KJS::Bindings::convertObjcValueToValue):
165         (KJS::Bindings::createObjcInstanceForValue):
166         * bindings/runtime.cpp:
167         (Instance::createBindingForLanguageInstance):
168         (Instance::createRuntimeObject):
169         (Instance::createLanguageInstanceForValue):
170         * bindings/runtime.h:
171         * kjs/interpreter.cpp:
172         (Interpreter::createLanguageInstanceForValue):
173         * kjs/interpreter.h:
174
175 === Safari-186 ===
176
177 2005-02-10  Darin Adler  <darin@apple.com>
178
179         "Reviewed" by Richard (he told me the file was obsolete).
180
181         - got rid of an obsolete file
182
183         * bindings/npsap.h: Removed.
184
185 === Safari-185 ===
186
187 === Safari-183 ===
188
189 2005-02-03  Richard Williamson   <rjw@apple.com>
190
191         Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
192
193         Revert to old (and correct) behavior of returning runtime object
194         when passed as a parameter, rather than it's corresponding DOM
195         object.
196
197         Reviewed by Chris.
198
199         * bindings/objc/WebScriptObject.mm:
200         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
201
202 === Safari-182 ===
203
204 2005-01-28  Richard Williamson   <rjw@apple.com>
205
206         Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
207
208         Only use special 'back door' property to get the runtime object if thisObj isn't
209         already a runtime object.
210
211         <gratuitous> Cleaned up a couple of strcmp on ClassInfo name.  Used == on
212         ClassInfo pointer instead.
213
214         Reviewed by Chris.
215
216         * bindings/c/c_utility.cpp:
217         (convertValueToNPVariant):
218         * bindings/objc/WebScriptObject.mm:
219         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
220         * bindings/runtime_method.cpp:
221         (RuntimeMethodImp::call):
222
223 === Safari-181 ===
224
225 2005-01-26  Richard Williamson   <rjw@apple.com>
226
227         Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
228
229         I added a member variable to ObjectImp.  This changed it's size and consequently
230         hampered the optimizations built into the garbage collector.  Objects no longer
231         fit within the allocators cell size, and thus allocation fell back to a slower
232         allocator.
233
234         As a result of this fix I also dramatically cleaned up how runtime objects are
235         accessed.  The path mostly *removes* code.
236         
237         Reviewed by Chris.
238
239         * bindings/runtime_method.cpp:
240         (RuntimeMethodImp::call):
241         * bindings/runtime_object.cpp:
242         (RuntimeObjectImp::get):
243         (RuntimeObjectImp::put):
244         (RuntimeObjectImp::canPut):
245         (RuntimeObjectImp::hasProperty):
246         (RuntimeObjectImp::defaultValue):
247         * bindings/runtime_object.h:
248         * kjs/object.cpp:
249         (KJS::ObjectImp::ObjectImp):
250         * kjs/object.h:
251
252 2005-01-20  Darin Adler  <darin@apple.com>
253
254         Reviewed by me, changes by Han Ming Ong.
255
256         - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
257
258         * bindings/objc/WebScriptObjectPrivate.h: Make members public.
259         * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
260
261 2005-01-20  Richard Williamson   <rjw@apple.com>
262
263         Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
264
265         The comprehensive fix for this problem requires new API, as described in 3965326.  However,
266         given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
267         like and Undefined object if  invokeUndefinedMethodFromWebScript:withArguments: isn't
268         implemented on the bound object.
269
270         Reviewed by Chris.
271
272         * bindings/objc/objc_runtime.h:
273         * bindings/objc/objc_runtime.mm:
274         (ObjcFallbackObjectImp::type):
275         (ObjcFallbackObjectImp::implementsCall):
276         (ObjcFallbackObjectImp::toBoolean):
277         * bindings/testbindings.mm:
278         (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
279         (+[MyFirstInterface isKeyExcludedFromWebScript:]):
280
281 === Safari-180 ===
282
283 2005-01-19  Richard Williamson   <rjw@apple.com>
284
285         Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
286
287         Fixed the following problems with LiveConnect that are demonstrated by the application
288         described in 3853676.
289
290         1.  If a nil object is passed in an array from Java to JavaScript we will crash.
291         2.  We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
292         3.  We will sometimes fail to find the correct static method ID.
293
294         Reviewed by Maciej.
295
296         * bindings/jni/jni_jsobject.cpp:
297         (JSObject::convertJObjectToValue):
298         (JSObject::listFromJArray):
299         * bindings/jni/jni_runtime.cpp:
300         (JavaField::valueFromInstance):
301         (JavaField::setValueToInstance):
302         * bindings/jni/jni_utility.cpp:
303         (KJS::Bindings::getMethodID):
304         (KJS::Bindings::convertValueToJValue):
305         * bindings/runtime_array.h:
306
307 2005-01-18  Richard Williamson   <rjw@apple.com>
308
309         Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
310
311         Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
312         Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
313         Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
314         Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
315
316         We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
317         tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
318         Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
319
320         Reviewed by Chris.
321
322         * bindings/objc/objc_instance.h:
323         * bindings/objc/objc_instance.mm:
324         (ObjcInstance::supportsSetValueOfUndefinedField):
325         * bindings/runtime.h:
326         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
327         * bindings/runtime_object.cpp:
328         (RuntimeObjectImp::RuntimeObjectImp):
329         (RuntimeObjectImp::get):
330         (RuntimeObjectImp::put):
331         (RuntimeObjectImp::canPut):
332         (RuntimeObjectImp::hasProperty):
333         (RuntimeObjectImp::defaultValue):
334         * bindings/runtime_object.h:
335         (KJS::RuntimeObjectImp::fallbackObject):
336         * kjs/object.cpp:
337         (KJS::ObjectImp::ObjectImp):
338         * kjs/object.h:
339         (KJS::ObjectImp::forwardingScriptMessage):
340         (KJS::ObjectImp::setForwardingScriptMessage):
341
342 2005-01-18  Richard Williamson   <rjw@apple.com>
343
344         Back out a change that was incorrectly committed yesterday.
345
346         Reviewed by Chris.
347
348         * bindings/objc/objc_utility.mm:
349         (KJS::Bindings::convertValueToObjcValue):
350
351 2005-01-17  Richard Williamson   <rjw@apple.com>
352
353         Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
354
355         Keep track of originating execution context and target execution
356         context for native JS object wrappers, and perform appropriate
357         security checks.
358
359         Reviewed by David Harrison.
360
361         * bindings/NP_jsobject.cpp:
362         (_isSafeScript):
363         (_NPN_CreateScriptObject):
364         (_NPN_Invoke):
365         (_NPN_Evaluate):
366         (_NPN_GetProperty):
367         (_NPN_SetProperty):
368         (_NPN_RemoveProperty):
369         (_NPN_HasProperty):
370         (_NPN_HasMethod):
371         (_NPN_SetException):
372         * bindings/NP_jsobject.h:
373         * bindings/c/c_instance.cpp:
374         (CInstance::CInstance):
375         (CInstance::stringValue):
376         * bindings/c/c_instance.h:
377         * bindings/c/c_utility.cpp:
378         (convertValueToNPVariant):
379         * bindings/jni/jni_instance.cpp:
380         (JavaInstance::JavaInstance):
381         (JavaInstance::valueOf):
382         * bindings/jni/jni_instance.h:
383         * bindings/objc/WebScriptObject.mm:
384         (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
385         (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
386         (-[WebScriptObject KJS::Bindings::]):
387         (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
388         (-[WebScriptObject _isSafeScript]):
389         (-[WebScriptObject callWebScriptMethod:withArguments:]):
390         (-[WebScriptObject evaluateWebScript:]):
391         (-[WebScriptObject setValue:forKey:]):
392         (-[WebScriptObject valueForKey:]):
393         (-[WebScriptObject removeWebScriptKey:]):
394         (-[WebScriptObject stringRepresentation]):
395         (-[WebScriptObject webScriptValueAtIndex:]):
396         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
397         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
398         * bindings/objc/WebScriptObjectPrivate.h:
399         * bindings/objc/objc_instance.h:
400         * bindings/objc/objc_runtime.mm:
401         (convertValueToObjcObject):
402         * bindings/objc/objc_utility.mm:
403         (KJS::Bindings::convertValueToObjcValue):
404         * bindings/runtime.cpp:
405         (Instance::Instance):
406         (Instance::operator=):
407         * bindings/runtime.h:
408         (KJS::Bindings::Instance::Instance):
409         (KJS::Bindings::Instance::setExecutionContext):
410         (KJS::Bindings::Instance::executionContext):
411         * bindings/runtime_root.cpp:
412         (RootObject::setInterpreter):
413         * bindings/runtime_root.h:
414         * kjs/interpreter.h:
415         (KJS::Interpreter::isGlobalObject):
416         (KJS::Interpreter::interpreterForGlobalObject):
417         (KJS::Interpreter::isSafeScript):
418
419 === Safari-179 ===
420
421 2005-01-13  Vicki Murley <vicki@apple.com>
422
423         Reviewed by Adele.
424
425         - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
426  
427         * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
428
429 2005-01-12  Richard Williamson   <rjw@apple.com>
430
431         Avoid additional work on dealloc by adding early out to
432         removeNativeReference().  (This will save time on dealloc
433         for all ObjC DOM objects.)
434
435         Reviewed by Darin.
436
437         * bindings/runtime_root.cpp:
438         (KJS::Bindings::removeNativeReference):
439
440 2005-01-12  Richard Williamson   <rjw@apple.com>
441
442         Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
443
444         We were always returning the first "root" object for all runtime
445         objects.  Changed 0 in loop to i, the index.
446
447         Reviewed by David Harrison.
448
449         * bindings/runtime_root.cpp:
450         (KJS::Bindings::rootForImp):
451
452 2005-01-11  Richard Williamson   <rjw@apple.com>
453
454         Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
455
456         Use the new dispatching API to invoke JNI, rather than calling JNI
457         directly.
458
459         Reviewed by David Harrison.
460
461         * bindings/jni/jni_instance.cpp:
462         (JavaInstance::invokeMethod):
463         * bindings/jni/jni_runtime.cpp:
464         (JavaField::dispatchValueFromInstance):
465         (JavaField::valueFromInstance):
466         (JavaField::dispatchSetValueToInstance):
467         (JavaField::setValueToInstance):
468         * bindings/jni/jni_runtime.h:
469         * bindings/jni/jni_utility.cpp:
470         (KJS::Bindings::convertValueToJValue):
471
472 === Safari-178 ===
473
474 === Safari-177 ===
475
476 === Safari-176 ===
477
478 2004-12-17  Maciej Stachowiak  <mjs@apple.com>
479
480         Reviewed by Kevin.
481
482         <rdar://problem/3926869> Opening caches window after running PLT causes crash
483         
484         * kjs/protected_values.cpp:
485         (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
486         the protected value table.
487         (KJS::ProtectedValues::increaseProtectCount): Ditto.
488         (KJS::ProtectedValues::decreaseProtectCount): Ditto.
489
490 2004-12-16  Darin Adler  <darin@apple.com>
491
492         Reviewed by Maciej.
493
494         - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
495
496         * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
497         * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
498         non-locale-specific versions.
499         * kjs/string_object.lut.h: Regenerated.
500
501 2004-12-14  Richard Williamson   <rjw@apple.com>
502
503         Pass URL of plugin view when call into JNI.
504
505         Reviewed by Chris.
506
507         * bindings/jni/jni_objc.mm:
508         (KJS::Bindings::dispatchJNICall):
509
510 2004-12-13  Richard Williamson   <rjw@apple.com>
511
512         Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
513
514         Add support for calling static Java methods from JavaScript.
515
516         Reviewed by Maciej.
517
518         * bindings/jni/jni_instance.cpp:
519         (JavaInstance::invokeMethod):
520         * bindings/jni/jni_runtime.cpp:
521         (JavaMethod::JavaMethod):
522         * bindings/jni/jni_runtime.h:
523         (KJS::Bindings::JavaMethod::isStatic):
524         * bindings/jni/jni_utility.cpp:
525         (callJNIStaticMethod):
526         (KJS::Bindings::callJNIBooleanMethod):
527         (KJS::Bindings::callJNIStaticBooleanMethod):
528         * bindings/jni/jni_utility.h:
529
530 2004-12-13  Richard Williamson   <rjw@apple.com>
531
532         Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
533
534         Reviewed by John.
535
536         * bindings/jni/jni_instance.cpp:
537         (JavaInstance::invokeMethod):
538         * bindings/jni/jni_objc.mm:
539         (KJS::Bindings::dispatchJNICall):
540         * bindings/jni/jni_runtime.h:
541         * bindings/jni/jni_utility.h:
542
543 === Safari-175 ===
544
545 2004-12-07  Maciej Stachowiak  <mjs@apple.com>
546
547         Reviewed by Darin.
548
549         <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
550
551         The fix was to implement copy constructor and assignment operator,
552         the ones that worked on the base class did not replace the
553         defaults apparently!
554         
555         * kjs/protect.h:
556         (KJS::ProtectedValue::ProtectedValue):
557         (KJS::ProtectedValue::operator=):
558         (KJS::ProtectedObject::ProtectedObject):
559         (KJS::ProtectedObject::operator=):
560         
561         Also fixed a bug in the GC test mode that compares the results of
562         the old collector and the new collector.
563
564         * kjs/value.cpp:
565         (ValueImp::mark):
566
567 === Safari-173 ===
568
569 2004-11-23  Richard Williamson   <rjw@apple.com>
570
571         Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
572
573         Reviewed by Ken.
574
575         * bindings/c/c_class.cpp:
576         (CClass::_commonInit):
577
578 2004-11-21  Maciej Stachowiak  <mjs@apple.com>
579
580         Reviewed by Ken.
581
582         <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
583         
584         * kjs/collector.cpp:
585         (KJS::Collector::Thread::Thread):
586         (KJS::destroyRegisteredThread):
587         (KJS::initializeRegisteredThreadKey):
588         (KJS::Collector::registerThread):
589         (KJS::Collector::markStackObjectsConservatively):
590         (KJS::Collector::markCurrentThreadConservatively):
591         (KJS::Collector::markOtherThreadConservatively):
592         * kjs/collector.h:
593         * kjs/internal.cpp:
594         (lockInterpreter):
595         * kjs/value.h:
596
597 === Safari-172 ===
598
599 2004-11-15  Richard Williamson   <rjw@apple.com>
600
601         Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
602
603         Reviewed by Hyatt.
604
605         * bindings/objc/objc_instance.mm:
606         (ObjcInstance::stringValue):
607         * bindings/objc/objc_utility.h:
608         * bindings/objc/objc_utility.mm:
609         (KJS::Bindings::convertNSStringToString):
610         (KJS::Bindings::convertObjcValueToValue):
611
612 === Safari-171 ===
613
614 2004-11-09  Chris Blumenberg  <cblu@apple.com>
615
616         Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
617
618         Reviewed by rjw.
619
620         * ChangeLog:
621         * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
622         * bindings/softlinking.c: Added.
623         (loadFramework): new
624         (getFunctionPointer): new
625         (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
626
627 === Safari-170 ===
628
629 2004-11-04  Darin Adler  <darin@apple.com>
630
631         Reviewed by Ken.
632
633         - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
634         - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
635           and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
636           than allocating a new one
637
638         * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
639         (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
640         of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
641         actually allocate only the very first time it's called.
642         (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
643         shared instance since there can be only one).
644         (-[WebUndefined copyWithZone:]): Ditto.
645         (-[WebUndefined retain]): Ditto.
646         (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
647         of class).
648         (-[WebUndefined autorelease]): Simplified to just return self (see above).
649         (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
650         (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
651         a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
652         bug mentioned above).
653         (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
654         No need to call init, since that's a no-op for this class.
655
656 2004-11-03  David Harrison  <harrison@apple.com>
657
658         Reviewed by Darin.
659         
660         Eliminate the use of a marker file to determine how to build.
661
662         * .cvsignore:
663         * Makefile.am:
664
665 2004-11-01  Richard Williamson   <rjw@apple.com>
666
667         Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
668
669         Reviewed by Ken.
670
671         * bindings/c/c_instance.cpp:
672         (CInstance::invokeMethod):
673         (CInstance::invokeDefaultMethod):
674         Initialize out parameters to void type.
675
676         * bindings/c/c_runtime.cpp:
677         (CField::valueFromInstance):
678         (CField::setValueToInstance):
679         Initialize out parameters to void type.
680         Also added additional checks to protect against classes that 
681         don't implement all functions.
682
683 2004-11-01  Richard Williamson   <rjw@apple.com>
684
685         Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
686
687         Reviewed by John.
688
689         * ChangeLog:
690         * bindings/objc/WebScriptObject.mm:
691         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
692         Added additional conversion Undefined -> WebUndefined.
693         * bindings/objc/objc_utility.mm:
694         (KJS::Bindings::convertObjcValueToValue):
695         Added additional conversion WebUndefined -> Undefined.
696
697 2004-11-01  Darin Adler  <darin@apple.com>
698
699         - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
700
701         * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
702         this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
703         report to match the contents of the file.
704
705 === Safari-169 ===
706
707 === Safari-168 ===
708
709 2004-10-22  Ken Kocienda  <kocienda@apple.com>
710
711         Reviewed by me
712
713         * JavaScriptCore.pbproj/project.pbxproj:  
714         Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
715
716 === Safari-167 ===
717
718 2004-10-13  Richard Williamson   <rjw@apple.com>
719
720         Moved boolean checks prior to NSNumber checks.  booleans are
721         NSNumbers.
722
723         Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
724
725         Reviewed by John.
726
727         * bindings/objc/objc_utility.mm:
728         (KJS::Bindings::convertObjcValueToValue):
729
730 2004-10-12  Richard Williamson   <rjw@apple.com>
731
732         Fixed access to DOM object via WebScriptObject API.
733         The execution context for DOM objects wasn't being found.       
734         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
735
736         Reviewed by Chris.
737
738         * bindings/objc/WebScriptObject.mm:
739         (_didExecute):
740         (-[WebScriptObject KJS::Bindings::]):
741         (-[WebScriptObject callWebScriptMethod:withArguments:]):
742         (-[WebScriptObject evaluateWebScript:]):
743         (-[WebScriptObject setValue:forKey:]):
744         (-[WebScriptObject valueForKey:]):
745         (-[WebScriptObject stringRepresentation]):
746         * bindings/objc/WebScriptObjectPrivate.h:
747
748 2004-10-09  Darin Adler  <darin@apple.com>
749
750         Reviewed by Kevin.
751
752         - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
753
754         * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
755         creating an init routine.
756
757         * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
758         require a global constructor that creates an init routine.
759
760 2004-10-09  Darin Adler  <darin@apple.com>
761
762         Reviewed by Kevin.
763
764         - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
765
766         * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
767         work with the window object of the page the function is in, not the page of the caller. This
768         is what all other browsers do. This code was hidden before by the "everything is defined on
769         window object" hack in WebCore.
770
771 2004-10-07  Richard Williamson   <rjw@apple.com>
772
773         Added simple JavaScript call tracing.  Very useful for
774         debugging complex pages.
775
776         Tracing is only available in development builds and is
777         enabled by:
778
779         (gdb) set traceJavaScript = 1
780
781         or programatically
782
783         setTraceJavaScript(true)
784
785         Function, args, and return values are printed to console.  Very
786         verbose.
787
788         Reviewed by Ken.
789
790         * kjs/function_object.cpp:
791         (FunctionProtoFuncImp::call):
792         * kjs/object.cpp:
793         (KJS::Object::call):
794
795 === Safari-166 ===
796
797 2004-10-05  Richard Williamson   <rjw@apple.com>
798
799         Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
800
801         Reviewed by Chris.
802
803         * bindings/NP_jsobject.cpp:
804         (_NPN_SetException):
805         * bindings/npruntime.cpp:
806         (_NPN_SetExceptionWithUTF8):
807         * bindings/objc/WebScriptObject.mm:
808         (+[WebScriptObject throwException:]):
809         * kjs/internal.h:
810         (KJS::InterpreterImp::context):
811
812 2004-10-05  Richard Williamson   <rjw@apple.com>
813
814         Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
815
816         Reviewed by Ken.
817
818         * bindings/objc/objc_utility.mm:
819         (KJS::Bindings::convertObjcValueToValue):
820
821 2004-10-04  Darin Adler  <darin@apple.com>
822
823         Reviewed by Ken.
824
825         - rolled in a fix the KDE folks did for the operations that generate HTML fragments
826
827         * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
828
829         - rolled out an old workaround we don't need any more
830
831         * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
832         required it is no longer there.
833
834 2004-09-30  Richard Williamson  <rjw@apple.com>
835
836         Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
837
838         Reviewed by Chris.
839
840         * bindings/NP_jsobject.cpp:
841         (_NPN_GetProperty):
842         (_NPN_HasProperty):
843         (_NPN_HasMethod):
844         * bindings/c/c_class.cpp:
845         (CClass::methodsNamed):
846         (CClass::fieldNamed):
847         * bindings/c/c_class.h:
848         * bindings/c/c_instance.cpp:
849         (CInstance::invokeMethod):
850         * bindings/jni/jni_class.cpp:
851         (JavaClass::methodsNamed):
852         * bindings/jni/jni_class.h:
853         * bindings/npruntime.h:
854         * bindings/objc/objc_class.h:
855         * bindings/objc/objc_class.mm:
856         (ObjcClass::methodsNamed):
857         * bindings/runtime.h:
858         * bindings/runtime_object.cpp:
859         (RuntimeObjectImp::get):
860         (RuntimeObjectImp::hasProperty):
861
862 2004-09-29  Chris Blumenberg  <cblu@apple.com>
863
864         Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
865
866         Reviewed by rjw.
867
868         * JavaScriptCore.pbproj/project.pbxproj:
869         * bindings/NP_jsobject.cpp:
870         (_NPN_CreateScriptObject):
871         (_NPN_InvokeDefault):
872         (_NPN_Invoke):
873         (_NPN_Evaluate):
874         (_NPN_GetProperty):
875         (_NPN_SetProperty):
876         (_NPN_RemoveProperty):
877         (_NPN_HasProperty):
878         (_NPN_HasMethod):
879         * bindings/c/c_class.cpp:
880         (CClass::methodsNamed):
881         (CClass::fieldNamed):
882         * bindings/c/c_instance.cpp:
883         (CInstance::CInstance):
884         (CInstance::~CInstance):
885         (CInstance::operator=):
886         (CInstance::invokeMethod):
887         (CInstance::invokeDefaultMethod):
888         * bindings/c/c_runtime.cpp:
889         * bindings/c/c_runtime.h:
890         (KJS::Bindings::CField::name):
891         (KJS::Bindings::CMethod::name):
892         * bindings/npruntime.cpp:
893         (_NPN_GetStringIdentifier):
894         (_NPN_GetStringIdentifiers):
895         (_NPN_GetIntIdentifier):
896         (_NPN_IdentifierIsString):
897         (_NPN_UTF8FromIdentifier):
898         (_NPN_IntFromIdentifier):
899         (NPN_InitializeVariantWithObject):
900         (_NPN_ReleaseVariantValue):
901         (_NPN_CreateObject):
902         (_NPN_RetainObject):
903         (_NPN_ReleaseObject):
904         (_NPN_SetExceptionWithUTF8):
905         (_NPN_SetException):
906
907 2004-09-26  Darin Adler  <darin@apple.com>
908
909         * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
910         low() to get Unicode value of character, and just use unicode().
911
912 2004-09-26  Darin Adler  <darin@apple.com>
913
914         - refine charAt/charCodeAt fix slightly
915
916         * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
917         omitted parameter, as we do everywhere else, and as other browsers do here.
918
919 2004-09-26  Darin Adler  <darin@apple.com>
920
921         Reviewed by Kevin.
922
923         - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
924
925         * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
926         the program. We were doing this properly for functions, but not entire programs.
927
928         - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
929
930         * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
931         and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
932
933         * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
934
935 === Safari-165 ===
936
937 === Safari-164 ===
938
939 2004-09-14  Richard Williamson   <rjw@apple.com>
940
941         1.  Add class parameter to object allocation function.  This is somewhat redundant, given that
942         the allocation function is in the class function vector, but people wanted to use the same
943         allocation function for different classes.
944         
945         2.  Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
946         
947         3.  Add support for a default function on an object.  This is a feature that ActiveX supports,
948         and will allow JavaScript code to be written that will look exactly the same for both ActiveX
949         plugins and Netscape or WebKit plugins.  There are implementations included for the 'C' and
950         'Objective-C' bindings.
951         
952         There bugs are covered by
953         
954         <rdar://problem/3776343> Support for default functions in the JavaScript bindings
955         <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
956         <rdar://problem/3674754> Need to implement latest npruntime.h
957
958         Reviewed by John.
959
960         * bindings/NP_jsobject.cpp:
961         (jsAllocate):
962         (NPN_InvokeDefault):
963         (NPN_Invoke):
964         * bindings/c/c_class.cpp:
965         * bindings/c/c_instance.cpp:
966         (CInstance::CInstance):
967         (CInstance::operator=):
968         (CInstance::invokeMethod):
969         (CInstance::invokeDefaultMethod):
970         * bindings/c/c_instance.h:
971         * bindings/c/c_runtime.cpp:
972         * bindings/c/c_runtime.h:
973         * bindings/jni/jni_instance.cpp:
974         (JavaInstance::invokeDefaultMethod):
975         * bindings/jni/jni_instance.h:
976         * bindings/npruntime.cpp:
977         (NPN_CreateObject):
978         * bindings/npruntime.h:
979         * bindings/objc/WebScriptObject.h:
980         * bindings/objc/objc_class.mm:
981         (ObjcClass::fallbackObject):
982         * bindings/objc/objc_instance.h:
983         * bindings/objc/objc_instance.mm:
984         (ObjcInstance::invokeDefaultMethod):
985         * bindings/objc/objc_runtime.h:
986         * bindings/objc/objc_runtime.mm:
987         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
988         (ObjcFallbackObjectImp::get):
989         (ObjcFallbackObjectImp::put):
990         (ObjcFallbackObjectImp::canPut):
991         (ObjcFallbackObjectImp::implementsCall):
992         (ObjcFallbackObjectImp::call):
993         (ObjcFallbackObjectImp::hasProperty):
994         (ObjcFallbackObjectImp::deleteProperty):
995         (ObjcFallbackObjectImp::defaultValue):
996         * bindings/runtime.h:
997         (KJS::Bindings::Class::fallbackObject):
998         (KJS::Bindings::Instance::getValueOfUndefinedField):
999         (KJS::Bindings::Instance::setValueOfUndefinedField):
1000         (KJS::Bindings::Instance::valueOf):
1001         * bindings/runtime_object.cpp:
1002         (RuntimeObjectImp::implementsCall):
1003         (RuntimeObjectImp::call):
1004         * bindings/runtime_object.h:
1005
1006 2004-09-13  Maciej Stachowiak  <mjs@apple.com>
1007
1008         Reviewed by Darin.
1009
1010         <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1011         
1012         * kjs/string_object.cpp:
1013         (StringProtoFuncImp::call): Replaced implementation of replace()
1014         method with function below...
1015         (replace): In order to avoid excessive allocation and copying,
1016         figure out the ranges of the original string and replacement
1017         strings to be assembled, instead of constantly creating new
1018         strings at each substitution. The old behavior is basically O(N^2)
1019         for a global replace on a pattern that matches many places in the
1020         string.
1021         (regExpIsGlobal): Helper function for the above.
1022         (expandSourceRanges): ditto
1023         (pushSourceRange): ditto
1024         (expandReplacements): ditto
1025         (pushReplacement): ditto
1026         * kjs/ustring.cpp:
1027         (KJS::UString::spliceSubstringsWithSeparators): New method that
1028         pieces together substring ranges of this string together with
1029         specified separators, all at one go.
1030         * kjs/ustring.h:
1031         (KJS::UString::Range::Range): Added new helper class to represent
1032         substring choices.
1033
1034 2004-09-14  Maciej Stachowiak  <mjs@apple.com>
1035
1036         Reviewed by Darin.
1037
1038         - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1039         
1040         * kjs/function.cpp:
1041         (KJS::GlobalFuncImp::call): Make sure to escape null
1042         characters. This is a bug in the new code that made part of the
1043         test fail.
1044
1045 2004-09-13  Darin Adler  <darin@apple.com>
1046
1047         Reviewed by Kevin and Maciej.
1048
1049         - new function to support fix for DIG bug in WebCore
1050
1051         * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1052         * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1053
1054 2004-09-12  Darin Adler  <darin@apple.com>
1055
1056         * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1057         of escape and unescape.
1058
1059 2004-09-12  Darin Adler  <darin@apple.com>
1060
1061         Reviewed by Maciej.
1062
1063         - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1064
1065         * kjs/date_object.cpp:
1066         (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1067         uses CFDateFormatter.
1068         (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1069
1070 2004-09-09  Maciej Stachowiak  <mjs@apple.com>
1071
1072         Reviewed by Richard.
1073
1074         <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1075
1076         * kjs/function.cpp:
1077         (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1078         ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1079         * kjs/lexer.cpp:
1080         (Lexer::isHexDigit): Made static and non-const.
1081         * kjs/lexer.h:
1082
1083 === Safari-163 ===
1084
1085 2004-09-06  Darin Adler  <darin@apple.com>
1086
1087         * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1088
1089 === Safari-162 ===
1090
1091 2004-09-01  Richard Williamson   <rjw@apple.com>
1092
1093         Add pid to exception messages (to help debug dashboard clients).
1094
1095         Reviewed by Chris.
1096
1097         * kjs/interpreter.cpp:
1098         (Interpreter::evaluate):
1099
1100 === Safari-161 ===
1101
1102 2004-08-20  Richard Williamson   <rjw@apple.com>
1103
1104         Implemented new JNI abstraction.  We no longer invoke Java methods
1105         directly with JNI, rather we call into the plugin.  This allows the
1106         plugin to dispatch the call to the appropriate VM thread.  This
1107         change should (will?) fix a whole class of threading related problems with
1108         the Java VM.
1109
1110         Reviewed by Hyatt.
1111
1112         * JavaScriptCore.pbproj/project.pbxproj:
1113         * bindings/c/c_instance.h:
1114         (KJS::Bindings::CInstance::setExecutionContext):
1115         (KJS::Bindings::CInstance::executionContext):
1116         * bindings/jni/jni_instance.cpp:
1117         (JavaInstance::JavaInstance):
1118         (JavaInstance::invokeMethod):
1119         (JavaInstance::setExecutionContext):
1120         (JavaInstance::executionContext):
1121         * bindings/jni/jni_instance.h:
1122         * bindings/jni/jni_jsobject.cpp:
1123         (JSObject::convertJObjectToValue):
1124         * bindings/jni/jni_runtime.cpp:
1125         (JavaField::JavaField):
1126         (JavaArray::convertJObjectToArray):
1127         (JavaField::valueFromInstance):
1128         (JavaArray::JavaArray):
1129         (JavaArray::valueAt):
1130         * bindings/jni/jni_runtime.h:
1131         (KJS::Bindings::JavaArray::operator=):
1132         (KJS::Bindings::JavaArray::executionContext):
1133         * bindings/jni/jni_utility.h:
1134         * bindings/objc/objc_instance.h:
1135         (KJS::Bindings::ObjcInstance::setExecutionContext):
1136         (KJS::Bindings::ObjcInstance::executionContext):
1137         * bindings/runtime.cpp:
1138         (Instance::createBindingForLanguageInstance):
1139         * bindings/runtime.h:
1140         * bindings/runtime_root.h:
1141         (KJS::Bindings::RootObject::nativeHandle):
1142
1143 === Safari-158 ===
1144
1145 2004-08-19  Vicki Murley  <vicki@apple.com>
1146
1147         Reviewed by John.
1148
1149         * kjs/property_map.cpp:
1150         (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1151
1152 2004-08-17  Darin Adler  <darin@apple.com>
1153
1154         Reviewed by Adele.
1155
1156         - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1157
1158         * kjs/property_map.h: Added some private functions.
1159         * kjs/property_map.cpp:
1160         (KJS::PropertyMap::clear): Set sentinelCount to 0.
1161         (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1162         Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1163         (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1164         (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1165         (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1166         deleted-element sentinels.
1167         (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1168
1169 2004-08-16  Maciej Stachowiak  <mjs@apple.com>
1170
1171         Code change by Eric Albert, reviewd by me.
1172
1173         <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1174
1175         * kjs/date_object.cpp:
1176         (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1177         entirely would be even better, but is not required to fix this bug.
1178
1179 === Safari-157 ===
1180
1181 2004-08-16  Richard Williamson   <rjw@apple.com>
1182
1183         Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1184
1185         Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1186
1187         Reviewed by Chris.
1188
1189         * bindings/NP_jsobject.cpp:
1190         (NPN_Evaluate):
1191         * bindings/jni/jni_jsobject.cpp:
1192         (JSObject::eval):
1193         * bindings/objc/WebScriptObject.mm:
1194         (-[WebScriptObject evaluateWebScript:]):
1195
1196 2004-08-15  Richard Williamson   <rjw@apple.com>
1197
1198         More updates to np headers.  Implemented new NPN functions.
1199
1200         Reviewed by Darin.
1201
1202         * bindings/NP_jsobject.cpp:
1203         (NPN_HasProperty):
1204         (NPN_HasMethod):
1205         * bindings/npapi.h:
1206         * bindings/npruntime.h:
1207
1208 2004-08-13  Darin Adler  <darin@apple.com>
1209
1210         - fix build so we can compile again
1211
1212         * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1213         is good enough so that we can compile, but it's only a stopgap measure, because I think
1214         Richard has a newer one he wants to check in.
1215
1216 2004-08-12  Richard Williamson   <rjw@apple.com>
1217
1218         Bring npruntime.h and friends closer to compliance with
1219         latest spec.
1220
1221         Reviewed by Maciej.
1222
1223         * JavaScriptCore.pbproj/project.pbxproj:
1224         * bindings/NP_jsobject.cpp:
1225         (jsAllocate):
1226         (_NPN_CreateScriptObject):
1227         (NPN_Call):
1228         (NPN_Evaluate):
1229         (NPN_GetProperty):
1230         (NPN_SetProperty):
1231         (NPN_RemoveProperty):
1232         * bindings/NP_jsobject.h:
1233         * bindings/c/c_instance.cpp:
1234         (CInstance::invokeMethod):
1235         * bindings/c/c_utility.cpp:
1236         (convertNPVariantToValue):
1237         * bindings/npruntime.cpp:
1238         (NPN_IdentifierIsString):
1239         (NPN_VariantIsVoid):
1240         (NPN_VariantIsNull):
1241         (NPN_VariantIsUndefined):
1242         (NPN_VariantIsBool):
1243         (NPN_VariantIsInt32):
1244         (NPN_VariantIsDouble):
1245         (NPN_VariantIsString):
1246         (NPN_VariantIsObject):
1247         (NPN_VariantToBool):
1248         (NPN_VariantToString):
1249         (NPN_VariantToInt32):
1250         (NPN_VariantToDouble):
1251         (NPN_VariantToObject):
1252         (NPN_InitializeVariantAsVoid):
1253         (NPN_InitializeVariantAsNull):
1254         (NPN_InitializeVariantAsUndefined):
1255         (NPN_InitializeVariantWithBool):
1256         (NPN_InitializeVariantWithInt32):
1257         (NPN_InitializeVariantWithDouble):
1258         (NPN_InitializeVariantWithString):
1259         (NPN_InitializeVariantWithStringCopy):
1260         (NPN_InitializeVariantWithObject):
1261         (NPN_InitializeVariantWithVariant):
1262         (NPN_ReleaseVariantValue):
1263         (NPN_CreateObject):
1264         * bindings/npruntime.h:
1265         (_NPString::):
1266         (_NPString::_NPVariant::):
1267         * bindings/npruntime_priv.h: Added.
1268
1269 2004-08-12  Darin Adler  <darin@apple.com>
1270
1271         Reviewed by Adele.
1272
1273         - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1274
1275         * kjs/function.cpp:
1276         (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1277         (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1278         (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1279         to skip leading "+" or "-".
1280
1281 === Safari-156 ===
1282
1283 2004-08-12  Darin Adler  <darin@apple.com>
1284
1285         Reviewed by Ken.
1286
1287         - fixed 43 Mozilla JavaScript tests
1288
1289         * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1290         * kjs/date_object.cpp:
1291         (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1292         than constructing a number object to pass to it.
1293         (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1294         (KJS::parseDate): Change to return a double instead of creating the Number object here.
1295         (KJS::timeClip): Implement this as specified in the language standard.
1296
1297         * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1298         flags on the prototype property.
1299
1300         * kjs/function.cpp:
1301         (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1302         currently in scope.
1303         (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1304         file later.
1305         (KJS::parseDigit): Added. Helper function for parseInt.
1306         (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1307         strtoll can handle. Also matches standard more closely.
1308         (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1309         instead of 0.
1310         (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1311
1312         * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1313
1314         * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1315         * kjs/lexer.cpp:
1316         (Lexer::setCode): Clear error state.
1317         (Lexer::lex): Set error state if the lexer encounters an error
1318
1319         * kjs/internal.cpp:
1320         (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1321         (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1322
1323         * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1324         Change round to round values between -0.5 and -0 to -0 instead of +0.
1325
1326         * kjs/nodes.h: Add evaluateReference function to GroupNode.
1327         * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1328         expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1329         would change x.y into a value that can't be deleted as a side effect.
1330
1331         * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1332         the specification.
1333
1334         * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1335         get rid of the fixed size limit for code.
1336
1337         * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1338         returns the string without creating a new Rep, since I'm using substr in a place where it will
1339         often be passed a 0.
1340
1341         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1342         the other day that was making a couple tests fail.
1343         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1344         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1345         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1346         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1347         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1348
1349         * kjs/string_object.lut.h: Regenerated.
1350
1351 2004-08-11  Darin Adler  <darin@apple.com>
1352
1353         - fixed a tiny problem with the UTF-16 PCRE check-in
1354
1355         * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1356         the ctype_meta flag to get set in items that should not have it.
1357
1358         * pcre/chartables.c: Regenerated.
1359
1360 2004-08-10  Richard Williamson   <rjw@apple.com>
1361
1362         Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1363
1364         The following WebScripting methods are now supported on bound
1365         objects:
1366
1367         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1368         - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1369         - (id)valueForUndefinedKey:(NSString *)key
1370
1371         Reviewed by Chris.
1372
1373         * bindings/c/c_class.cpp:
1374         (CClass::fieldNamed):
1375         * bindings/c/c_class.h:
1376         * bindings/jni/jni_class.cpp:
1377         (JavaClass::fieldNamed):
1378         * bindings/jni/jni_class.h:
1379         * bindings/objc/objc_class.h:
1380         (KJS::Bindings::ObjcClass::isa):
1381         * bindings/objc/objc_class.mm:
1382         (ObjcClass::methodsNamed):
1383         (ObjcClass::fieldNamed):
1384         (ObjcClass::fallbackObject):
1385         * bindings/objc/objc_instance.h:
1386         * bindings/objc/objc_instance.mm:
1387         (ObjcInstance::invokeMethod):
1388         (ObjcInstance::setValueOfField):
1389         (ObjcInstance::setValueOfUndefinedField):
1390         (ObjcInstance::getValueOfField):
1391         (ObjcInstance::getValueOfUndefinedField):
1392         * bindings/objc/objc_runtime.h:
1393         (KJS::Bindings::ObjcField::~ObjcField):
1394         (KJS::Bindings::ObjcField::ObjcField):
1395         (KJS::Bindings::ObjcField::operator=):
1396         (KJS::Bindings::FallbackObjectImp::classInfo):
1397         * bindings/objc/objc_runtime.mm:
1398         (ObjcField::ObjcField):
1399         (ObjcField::name):
1400         (ObjcField::type):
1401         (ObjcField::valueFromInstance):
1402         (ObjcField::setValueToInstance):
1403         (FallbackObjectImp::FallbackObjectImp):
1404         (FallbackObjectImp::get):
1405         (FallbackObjectImp::put):
1406         (FallbackObjectImp::canPut):
1407         (FallbackObjectImp::implementsCall):
1408         (FallbackObjectImp::call):
1409         (FallbackObjectImp::hasProperty):
1410         (FallbackObjectImp::deleteProperty):
1411         (FallbackObjectImp::defaultValue):
1412         * bindings/runtime.h:
1413         (KJS::Bindings::Class::fallbackObject):
1414         (KJS::Bindings::Instance::getValueOfUndefinedField):
1415         (KJS::Bindings::Instance::setValueOfUndefinedField):
1416         * bindings/runtime_object.cpp:
1417         (RuntimeObjectImp::get):
1418         (RuntimeObjectImp::put):
1419         (RuntimeObjectImp::canPut):
1420         (RuntimeObjectImp::hasProperty):
1421         * bindings/testbindings.mm:
1422         (-[MyFirstInterface valueForUndefinedKey:]):
1423         (-[MyFirstInterface setValue:forUndefinedKey:]):
1424
1425 2004-08-10  Darin Adler  <darin@apple.com>
1426
1427         Reviewed by Dave.
1428
1429         - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1430
1431         * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1432         or uint16_t depending on the mode, and used appropriate in the 7 public functions
1433         that need to use it.
1434         * pcre/pcre.c: Add UTF-16 support to all functions.
1435         * pcre/study.c: Ditto.
1436
1437         * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1438         the mode. Changed declarations to use symbolic constants and typedefs so we size
1439         things to ichar when needed.
1440
1441         * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1442         sized to 16-bit characters instead of 8-bit.
1443
1444         * pcre/get.c:
1445         (pcre_copy_substring): Use pcre_char instead of char.
1446         (pcre_get_substring_list): Ditto.
1447         (pcre_free_substring_list): Ditto.
1448         (pcre_get_substring): Ditto.
1449         (pcre_free_substring): Ditto.
1450
1451         * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1452         of hard-coding 8-bit table sizes.
1453
1454         * pcre/chartables.c: Regenerated.
1455
1456         * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1457         * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1458         is not null. The null string still has a null pointer. This prevents us from
1459         passing a null through to the regular expression engine (which results in a null
1460         error even when the string length is 0).
1461
1462         * kjs/regexp.cpp:
1463         (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1464         (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1465
1466 2004-08-09  Darin Adler  <darin@apple.com>
1467
1468         Reviewed by Maciej.
1469
1470         - fixed 28 Mozilla JavaScript tests
1471
1472         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1473         checking the number of arguments for the join method.
1474
1475         * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1476         than integers, so we aren't limited to 32 bits.
1477
1478         * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1479         the implementation of the pow operation. Also simplied a case that was handling positive
1480         and negative infinity separately.
1481
1482         * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1483         putting them in a long, so that unsigned shift will work properly.
1484
1485         * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1486
1487         * kjs/operations.cpp:
1488         (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1489         sign of isinf; our isinf function returns +1 even for negative infinity.
1490         (KJS::isNegInf): And again.
1491         (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1492         Our floating point already handles the various infinity cases correctly.
1493
1494         * kjs/regexp_object.cpp:
1495         (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1496         (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1497         array in cases where we did not match.
1498         (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1499         "global", "ignoreCase", "multiline", and "source".
1500
1501         * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1502         string into undefined rather than an empty string. For the slice method, handle an
1503         undefined parameter for the limit properly as decribed in the specification, and add
1504         the limit to one case that didn't have the limit at all. For the methods that generate
1505         HTML strings, use lowercase tags instead of uppercase.
1506
1507         * kjs/ustring.cpp:
1508         (KJS::UChar::toLower): Use u_tolower from the ICU library.
1509         (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1510         (KJS::UString::append): Fix some math that caused a buffer overflow.
1511         (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1512         flag) rather than converting them all to 0.
1513         (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1514
1515         * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1516
1517         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1518         the Unicode specification in a few cases where it was wrong before.
1519         * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1520         * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1521         * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1522         * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1523         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1524         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1525         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1526         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1527         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1528
1529         * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1530
1531         * kjs/number_object.lut.h: Regenerated.
1532
1533 2004-08-09  Darin Adler  <darin@apple.com>
1534
1535         Reviewed by Maciej.
1536
1537         - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1538
1539         * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1540         we get a buffer overflow.
1541
1542 === Safari-155 ===
1543
1544 2004-08-05  Richard Williamson   <rjw@apple.com>
1545
1546         Fixed part of 3674747.  The QT guys need this for feature freeze.
1547
1548         This patch implements support for the
1549
1550         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1551
1552         method of objects bound to JavaScript.
1553
1554         Reviewed by John.
1555
1556         * ChangeLog:
1557         * bindings/objc/objc_class.mm:
1558         (ObjcClass::methodsNamed):
1559         (ObjcClass::fieldNamed):
1560         * bindings/objc/objc_instance.mm:
1561         (ObjcInstance::invokeMethod):
1562         * bindings/objc/objc_runtime.h:
1563         (KJS::Bindings::ObjcMethod::~ObjcMethod):
1564         (KJS::Bindings::ObjcMethod::isFallbackMethod):
1565         (KJS::Bindings::ObjcMethod::javaScriptName):
1566         * bindings/objc/objc_runtime.mm:
1567         (ObjcMethod::ObjcMethod):
1568         (ObjcMethod::getMethodSignature):
1569         (ObjcMethod::setJavaScriptName):
1570         * bindings/testbindings.mm:
1571
1572 2004-08-04  Vicki Murley  <vicki@apple.com>
1573
1574         Reviewed by mjs.
1575  
1576         - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error        
1577
1578         * kjs/lexer.cpp:
1579         (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1580         go to the next line and continue parsing the string (instead of failing).  This matches 
1581         behavior in Mac IE and Mozilla.
1582
1583 2004-08-03  Kevin Decker  <kdecker@apple.com>
1584
1585         Reviewed by Darin.
1586
1587         Rolled in changes from the latest KJS sources that support additional 
1588         Number.prototype functions. 
1589
1590         Specifically this patch covers the follow parts of the ECMA 3 spec:
1591         15.7.4.5, 15.7.4.6, and 15.7.4.7 
1592         
1593         Fixes:
1594         <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1595         <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1596         <rdar://problem/3749591> missing Number.toExponential prototype implementation
1597
1598         * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1599         list of supported identifiers (a macro).
1600         * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1601         and toExponential(). 
1602         (NumberPrototypeImp::NumberPrototypeImp):
1603         (NumberProtoFuncImp::call):
1604         * kjs/number_object.h: Added property names for toFixed, toPrecision,
1605         and toExponential. 
1606         (KJS::NumberProtoFuncImp::):
1607         * tests/mozilla/expected.html: Update results.
1608
1609 2004-08-03  Darin Adler  <darin@apple.com>
1610
1611         Reviewed by Ken.
1612
1613         - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1614
1615         * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1616         we are supposed to just copy the regular expression object, and do so.
1617         Also tighten up arguments check to handle case where an actual "undefined"
1618         is passed rather than just omitting an argument.
1619
1620         * tests/mozilla/expected.html: Update results.
1621
1622 2004-08-02  Darin Adler  <darin@apple.com>
1623
1624         * tests/mozilla/.cvsignore: Added.
1625         * tests/mozilla/expected.html: Update results.
1626
1627 2004-08-02  Darin Adler  <darin@apple.com>
1628
1629         Reviewed by Ken.
1630
1631         - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1632
1633         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1634         Append the flags here so more tests paseed.
1635
1636 2004-08-02  Darin Adler  <darin@apple.com>
1637
1638         Reviewed by Ken.
1639
1640         - fixed a couple things making 5 Mozilla regexp tests pass
1641
1642         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1643         for the prototype.
1644         (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1645         be used as the flags string when no parameter was passed.
1646
1647         * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1648         Added a class info object for RegExp prototype so it can return
1649         a string instead of raising an exception when converting to a string.
1650
1651         * tests/mozilla/expected.html: Update results.
1652
1653 2004-08-02  Darin Adler  <darin@apple.com>
1654
1655         Reviewed by Kevin.
1656
1657         - fix crashes in mozilla tests due to mishandling NaN
1658
1659         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1660         calls to toInteger so that NaN will get turned into something that fits in an integer.
1661         These were the ones John already fixed, but his fix used isnan and the new fix is
1662         more efficient.
1663
1664         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1665         after a call to toInteger to handle NaN properly. Also removed separate check
1666         for undefined that's not needed.
1667
1668         * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1669         as in the above two files, but for a lot more functions. Also changed one place with
1670         an explicit check for undefined to instead just check isNaN.
1671
1672         * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1673         like me who don't keep $SYMROOTS in their $PATH.
1674
1675 === Safari-154 ===
1676
1677 === Safari-153 ===
1678
1679 2004-07-26  Kevin Decker  <kdecker@apple.com>
1680
1681         Changes done by Darin, reviewed by Kevin.
1682
1683         - changed testkjs to build in Xcode rather than from Makefile
1684
1685         * .cvsignore: Removed obsolete files from this list.
1686         * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1687         Changed to build target "All" rather than default target. This makes us
1688         build the testkjs test tool.
1689         * dummy.cpp: Removed.
1690         * kjs/.cvsignore: Removed obsolete files from this list, including
1691         the testkjs tool, which is now built in the symroots directory.
1692         * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1693         changed this file. Also this has the nice side effect of causing the tool
1694         to be rebuilt in the new location even if there are no other changes in
1695         your tree when you check this out.
1696         * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1697         without setting the execute bit on jsDriver.pl.
1698
1699 2004-07-22  Kevin Decker  <kdecker@apple.com>
1700
1701         Reviewed by Darin
1702         
1703         Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions). 
1704
1705         * kjs/function_object.cpp:
1706         (FunctionObjectImp::construct):
1707         * kjs/function_object.h:
1708         * kjs/object.cpp:
1709         (KJS::ObjectImp::construct):
1710         * kjs/object.h:
1711         (KJS::Object::construct):
1712
1713 2004-07-21  Darin Adler  <darin@apple.com>
1714
1715         * bindings/npruntime.h: Fixed typo.
1716
1717 2004-07-19  John Sullivan  <sullivan@apple.com>
1718
1719         Reviewed by Maciej.
1720         
1721         - bulletproofed array.slice() against NAN arguments. Harri noticed this
1722         vulnerability in my patch for 3714644
1723
1724         * kjs/array_object.cpp:
1725         (ArrayProtoFuncImp::call):
1726         handle NAN parameters passed to slice() by clamping to 0 and length.
1727
1728 2004-07-19  Richard Williamson   <rjw@apple.com>
1729
1730         Fixed 3733349.  Prevent Java applet callbacks into JavaScript after applet
1731         has been destroyed.
1732
1733         Reviewed by John.
1734
1735         * bindings/jni/jni_jsobject.cpp:
1736         (JSObject::invoke):
1737         (JSObject::JSObject):
1738
1739 2004-07-16  John Sullivan  <sullivan@apple.com>
1740
1741         Reviewed by Maciej.
1742         
1743         - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link 
1744         hangs browser with javascript
1745
1746         * kjs/array_object.cpp:
1747         (ArrayProtoFuncImp::call):
1748         Check for undefined type for args[0] the same way we were already checking
1749         for args[1]. In this case, args was zero-length, but we were treating
1750         args[0] like an integer anyway. Resulted in some code looping from a NAN
1751         value to 4, taking approximately forever.
1752
1753         * JavaScriptCore.pbproj/project.pbxproj:
1754         version wars
1755         
1756 === Safari-152 ===
1757
1758 2004-07-14  Maciej Stachowiak  <mjs@apple.com>
1759
1760         Reviewed by John.
1761
1762         <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1763         <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1764
1765         * kjs/number_object.cpp:
1766         (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1767
1768 2004-07-13  Kevin Decker  <kdecker@apple.com>
1769
1770         Reviewed by kocienda.
1771
1772         - made testkjs and JavaScriptCore a subtarget of 'All'
1773         - testkjs now builds in $SYMROOTS
1774
1775         * JavaScriptCore.pbproj/project.pbxproj:
1776
1777 === Safari-151 ===
1778
1779 2004-06-24  Chris Blumenberg  <cblu@apple.com>
1780
1781         Ignore .mode1 files in JavaScriptCore.pbproj
1782
1783         Reviewed by kocienda.
1784
1785         * JavaScriptCore.pbproj/.cvsignore:
1786
1787 2004-06-23  Richard Williamson   <rjw@apple.com>
1788
1789         Implemented changes for latest npruntime.h.
1790         
1791         Reviewed by Chris.
1792
1793         * JavaScriptCore.pbproj/project.pbxproj:
1794         * bindings/NP_jsobject.cpp:
1795         (listFromVariantArgs):
1796         (identiferFromNPIdentifier):
1797         (_NPN_CreateScriptObject):
1798         (NPN_Call):
1799         (NPN_Evaluate):
1800         (NPN_GetProperty):
1801         (NPN_SetProperty):
1802         (NPN_RemoveProperty):
1803         * bindings/NP_jsobject.h:
1804         * bindings/c/c_class.cpp:
1805         (CClass::methodsNamed):
1806         (CClass::fieldNamed):
1807         * bindings/c/c_instance.cpp:
1808         (CInstance::invokeMethod):
1809         * bindings/c/c_utility.cpp:
1810         (convertNPVariantToValue):
1811         * bindings/c/c_utility.h:
1812         * bindings/npruntime.cpp:
1813         (stringIdentifierEqual):
1814         (stringIdentifierHash):
1815         (getStringIdentifierDictionary):
1816         (intIdentifierEqual):
1817         (intIdentifierHash):
1818         (getIntIdentifierDictionary):
1819         (NPN_GetStringIdentifier):
1820         (NPN_GetStringIdentifiers):
1821         (NPN_GetIntIdentifier):
1822         (NPN_IdentifierIsString):
1823         (NPN_UTF8FromIdentifier):
1824         (NPN_VariantToInt32):
1825         (NPN_VariantToDouble):
1826         (NPN_SetException):
1827         * bindings/npruntime.h:
1828         * bindings/objc/WebScriptObject.mm:
1829         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1830         * bindings/runtime_object.cpp:
1831         (RuntimeObjectImp::~RuntimeObjectImp):
1832         * bindings/runtime_root.cpp:
1833         (KJS::Bindings::rootForInterpreter):
1834         * bindings/testbindings.cpp:
1835         (initializeIdentifiers):
1836         (logMessage):
1837         (setDoubleValue):
1838         (setIntValue):
1839         (setBooleanValue):
1840
1841 === JavaScriptCore-146.1 ===
1842
1843 2004-06-16  Richard Williamson   <rjw@apple.com>
1844
1845         Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1846
1847         This turned out to be a show stopper for Dashboard.  Accessing a nil
1848         ObjC property from JS caused a crash.  Similar to the problem
1849         3696112 fixed below.
1850         
1851         Reviewed by Trey.
1852
1853         * bindings/objc/objc_runtime.mm:
1854         (KJS::Bindings::ObjcField::valueFromInstance):
1855
1856 === Safari-146 ===
1857
1858 2004-06-16  Richard Williamson   <rjw@apple.com>
1859
1860         Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1861
1862         This turned out to be a show stopper for Dashboard.  We now
1863         return Undefined() when nil is returned from a ObjC method
1864         that returns an object type.
1865         
1866         Reviewed by Maciej.
1867
1868         * bindings/objc/objc_utility.mm:
1869         (KJS::Bindings::convertObjcValueToValue):
1870
1871 === Safari-145 ===
1872
1873 2004-06-15  Richard Williamson   <rjw@apple.com>
1874
1875         Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1876
1877         No longer need to check respondsToSelector: for
1878         isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1879         because these now have a default implementation on NSObject.
1880
1881         Reviewed by Trey.
1882
1883         * bindings/objc/objc_class.mm:
1884         (ObjcClass::methodsNamed):
1885         (ObjcClass::fieldNamed):
1886
1887 2004-06-14  Darin Adler  <darin@apple.com>
1888
1889         Reviewed by Maciej.
1890
1891         - fixed some things for GC that Patrick missed, or that happened after the branch
1892
1893         * bindings/objc/WebScriptObject.mm:
1894         (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1895         (-[WebScriptObject finalize]): Added.
1896
1897         - added some missing nil checks
1898
1899         * bindings/objc/objc_instance.mm:
1900         (ObjcInstance::ObjcInstance): Check for nil.
1901         (ObjcInstance::~ObjcInstance): Check for nil.
1902         (ObjcInstance::operator=): Check for nil.
1903
1904 2004-06-14  Darin Adler  <darin@apple.com>
1905
1906         Reviewed by me, code changes by Patrick Beard.
1907
1908         - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1909
1910         * bindings/objc/objc_instance.mm:
1911         (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1912         (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1913         (ObjcInstance::operator=): More of the same.
1914         (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1915
1916         * bindings/objc/objc_runtime.mm:
1917         (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1918         (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1919         (ObjcArray::operator=): More of the same.
1920
1921         * bindings/testbindings.mm: Fixed incorrect license.
1922         (main): Use [pool drain] if compiling on Tiger.
1923
1924 === Safari-144 ===
1925
1926 2004-06-10  Kevin Decker  <kdecker@apple.com>
1927
1928         Reviewed by John.
1929
1930         * kjs/lexer.cpp: 
1931         (Lexer::setCode):
1932             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1933         * kjs/lexer.h:
1934         (KJS::Lexer::lineNo):
1935             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1936
1937 === JavaScriptCore-143.2 ===
1938
1939 2004-06-07  Darin Adler  <darin@apple.com>
1940
1941         - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1942
1943         * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1944         * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1945
1946 === JavaScriptCore-143.1 ===
1947
1948 2004-06-04  Kevin Decker  <kdecker@apple.com>
1949
1950         Reviewed by Darin
1951         
1952         - fixed <rdar://problem/3680594>
1953
1954         * kjs/object.cpp:
1955         (KJS::Error::create):
1956
1957 === Safari-143 ===
1958
1959 2004-06-04  Darin Adler  <darin@apple.com>
1960
1961         * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1962
1963 2004-06-04  Kevin Decker  <kdecker@apple.com>
1964
1965         Reviewed by Dave.
1966
1967         - ObjC bindings do not (yet) pass along sourceurl or line numbers
1968         - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1969         - changed the wording of an error message
1970         - the lexer, parser, and interpreter have been made "sourceURL aware"
1971         - stored the url into Error
1972          
1973         * bindings/NP_jsobject.cpp:
1974         (NPN_Evaluate):
1975         * bindings/jni/jni_jsobject.cpp:
1976         (JSObject::eval):
1977         * bindings/objc/WebScriptObject.mm:
1978         (-[WebScriptObject evaluateWebScript:]):
1979         * kjs/function.cpp:
1980         (GlobalFuncImp::call):
1981         * kjs/function_object.cpp:
1982         (FunctionObjectImp::construct):
1983         * kjs/internal.cpp:
1984         (Parser::parse):
1985         (InterpreterImp::checkSyntax):
1986         (InterpreterImp::evaluate):
1987         * kjs/internal.h:
1988         * kjs/interpreter.cpp:
1989         (Interpreter::evaluate):
1990         * kjs/interpreter.h:
1991         * kjs/lexer.cpp:
1992         (Lexer::setCode):
1993         * kjs/lexer.h:
1994         (KJS::Lexer::sourceURL):
1995         * kjs/nodes.cpp:
1996         (Node::Node):
1997         (Node::throwError):
1998         (FunctionCallNode::evaluate):
1999         * kjs/nodes.h:
2000         * kjs/object.cpp:
2001         (KJS::Error::create):
2002         * kjs/object.h:
2003
2004 2004-06-04  Richard Williamson   <rjw@apple.com>
2005
2006         Fixed crash when attempting to access properties on nil
2007         object.
2008         
2009         Reviewed by John.
2010
2011         * bindings/objc/objc_instance.mm:
2012         (ObjcInstance::getClass):
2013         * bindings/runtime_object.cpp:
2014         (RuntimeObjectImp::get):
2015         * bindings/testM.js:
2016         * bindings/testbindings.mm:
2017         (-[MyFirstInterface getString]):
2018
2019 2004-05-27  Kevin Decker  <kdecker@apple.com>
2020
2021         Reviewed by Ken.
2022
2023         -revised generated error message content
2024         
2025         * kjs/error_object.cpp:
2026         (ErrorProtoFuncImp::call):
2027         * kjs/internal.cpp:
2028         (Parser::parse):
2029         * kjs/object.cpp:
2030         (KJS::Error::create):
2031
2032 === Safari-142 ===
2033
2034 2004-05-27  Richard Williamson   <rjw@apple.com>
2035
2036         Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2037
2038         Reviewed by Chris.
2039
2040         * bindings/objc/WebScriptObject.h:
2041
2042 2004-05-27  Darin Adler  <darin@apple.com>
2043
2044         Reviewed by Maciej.
2045
2046         - moved to new symlink technique for embedding frameworks
2047
2048         * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2049         because we don't need it any more.
2050
2051 2004-05-24  Richard Williamson   <rjw@apple.com>
2052
2053         Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2054         fixed ClassInfo to correctly reflect inheritance.  This is required
2055         because of the runtime checks in JSC for arrays, i.e. in
2056         the Function objects apply method.
2057
2058         Reviewed by Ken.
2059
2060         * bindings/jni/jni_runtime.cpp:
2061         (JavaArray::convertJObjectToArray):
2062         * bindings/objc/objc_utility.mm:
2063         (KJS::Bindings::convertObjcValueToValue):
2064         * bindings/runtime_array.cpp:
2065         (RuntimeArrayImp::RuntimeArrayImp):
2066         * bindings/runtime_array.h:
2067         * bindings/testM.js: Added.
2068         * bindings/testbindings.mm:
2069         (+[MyFirstInterface webScriptNameForSelector:]):
2070         (-[MyFirstInterface logMessages:]):
2071         (-[MyFirstInterface logMessage:prefix:]):
2072         (-[MyFirstInterface callJSObject::]):
2073
2074 2004-05-22  Darin Adler  <darin@apple.com>
2075
2076         Reviewed by Maciej.
2077
2078         - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2079
2080         * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2081         with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2082         CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2083         it hasn't been set explicitly.
2084
2085 === Safari-141 ===
2086
2087 2004-05-20  Richard Williamson   <rjw@apple.com>
2088
2089         Implemented WebScriptObject/DOM wrapper voodoo.  DOM wrappers
2090         can now be referenced like any other WebScriptObject, meaning
2091         you can do JS operations on them.
2092
2093         All added implementation of finalizeForWebScript.
2094
2095         Reviewed by Ken.
2096
2097         * bindings/objc/WebScriptObject.h:
2098         * bindings/objc/WebScriptObject.mm:
2099         (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2100         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2101         (-[WebScriptObject KJS::]):
2102         (-[WebScriptObject dealloc]):
2103         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2104         (-[WebScriptObject evaluateWebScript:]):
2105         (-[WebScriptObject setValue:forKey:]):
2106         (-[WebScriptObject valueForKey:]):
2107         (-[WebScriptObject stringRepresentation]):
2108         * bindings/objc/WebScriptObjectPrivate.h:
2109         * bindings/objc/objc_instance.mm:
2110         (ObjcInstance::~ObjcInstance):
2111
2112 2004-05-19  Richard Williamson   <rjw@apple.com>
2113
2114         Removed extraneous tabs that were added (by XCode?).
2115
2116         * bindings/objc/WebScriptObject.h:
2117
2118 2004-05-19  Darin Adler  <darin@apple.com>
2119
2120         - fixed headers with licenses mangled by Xcode auto-indenting
2121
2122         * bindings/jni/jni_jsobject.cpp:
2123         * bindings/jni/jni_jsobject.h:
2124         * bindings/runtime_array.h:
2125         * bindings/runtime_root.cpp:
2126         * bindings/runtime_root.h:
2127
2128 2004-05-18  Richard Williamson   <rjw@apple.com>
2129
2130         Added exception logging.  Also check for exception and
2131         set results as appropriate.
2132
2133         Reviewed by Maciej (partially reviewed).
2134
2135         * bindings/objc/WebScriptObject.mm:
2136         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2137         (-[WebScriptObject evaluateWebScript:]):
2138         (-[WebScriptObject setValue:forKey:]):
2139         (-[WebScriptObject valueForKey:]):
2140
2141 2004-05-18  Richard Williamson   <rjw@apple.com>
2142
2143         Finsished implementing support for windowScriptObject.
2144         Had to make WebScriptObjectPrivate.h accessible from
2145         WebCore.
2146
2147         Reviewed by Maciej.
2148
2149         * JavaScriptCore.pbproj/project.pbxproj:
2150         * bindings/objc/WebScriptObjectPrivate.h:
2151
2152 2004-05-18  Richard Williamson   <rjw@apple.com>
2153
2154         Use KVC to set/get values instead of directly accessing
2155         ivars.
2156
2157         Reviewed by Maciej.
2158
2159         * bindings/objc/WebScriptObject.mm:
2160         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2161         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2162         * bindings/objc/objc_runtime.mm:
2163         (ObjcField::valueFromInstance):
2164         (convertValueToObjcObject):
2165         (ObjcField::setValueToInstance):
2166
2167 2004-05-17  Richard Williamson   <rjw@apple.com>
2168
2169         Implemented new API for WebScriptObject.
2170
2171         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2172         Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object)  (w/ help from Vicki)
2173
2174         Reviewed by Hyatt.
2175
2176         * JavaScriptCore.pbproj/project.pbxproj:
2177         * bindings/c/c_instance.cpp:
2178         (CInstance::invokeMethod):
2179         * bindings/jni/jni_instance.cpp:
2180         (JavaInstance::invokeMethod):
2181         * bindings/jni/jni_jsobject.cpp:
2182         (JSObject::convertValueToJObject):
2183         * bindings/jni/jni_utility.cpp:
2184         (KJS::Bindings::getJNIField):
2185         * bindings/objc/WebScriptObject.mm:
2186         (_didExecute):
2187         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2188         (-[WebScriptObject KJS::]):
2189         (-[WebScriptObject dealloc]):
2190         (+[WebScriptObject throwException:]):
2191         (listFromNSArray):
2192         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2193         (-[WebScriptObject evaluateWebScript:]):
2194         (-[WebScriptObject setValue:forKey:]):
2195         (-[WebScriptObject valueForKey:]):
2196         (-[WebScriptObject stringRepresentation]):
2197         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2198         (+[WebUndefined undefined]):
2199         (-[WebUndefined initWithCoder:]):
2200         (-[WebUndefined encodeWithCoder:]):
2201         (-[WebUndefined copyWithZone:]):
2202         (-[WebUndefined retain]):
2203         (-[WebUndefined release]):
2204         (-[WebUndefined retainCount]):
2205         (-[WebUndefined autorelease]):
2206         (-[WebUndefined dealloc]):
2207         (-[WebUndefined copy]):
2208         (-[WebUndefined replacementObjectForPortCoder:]):
2209         * bindings/objc/WebScriptObjectPrivate.h: Added.
2210         * bindings/objc/objc_class.mm:
2211         (ObjcClass::methodsNamed):
2212         (ObjcClass::fieldNamed):
2213         * bindings/objc/objc_instance.mm:
2214         (ObjcInstance::invokeMethod):
2215         * bindings/objc/objc_jsobject.h:
2216         * bindings/objc/objc_jsobject.mm:
2217         * bindings/objc/objc_runtime.mm:
2218         (ObjcField::valueFromInstance):
2219         * bindings/objc/objc_utility.mm:
2220         (KJS::Bindings::JSMethodNameToObjCMethodName):
2221         (KJS::Bindings::convertValueToObjcValue):
2222         (KJS::Bindings::convertObjcValueToValue):
2223         * bindings/runtime.cpp:
2224         (Instance::setDidExecuteFunction):
2225         (Instance::didExecuteFunction):
2226         (Instance::setValueOfField):
2227         * bindings/runtime.h:
2228         * bindings/testbindings.mm:
2229         (+[MyFirstInterface webScriptNameForSelector:]):
2230         (-[MyFirstInterface callJSObject::]):
2231
2232 2004-05-14  Vicki Murley  <vicki@apple.com>
2233
2234         Reviewed by mjs.
2235  
2236         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2237
2238         * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2239
2240 === Safari-140 ===
2241
2242 2004-05-13  Richard Williamson   <rjw@apple.com>
2243
2244         Fixed indentation.
2245
2246         Reviewed by Chris.
2247
2248         * ChangeLog:
2249         * bindings/objc/WebScriptObject.h:
2250
2251 2004-05-13  Richard Williamson   <rjw@apple.com>
2252
2253         Approved API changes.  Currently unimplemented.
2254
2255         Reviewed by Chris.
2256
2257         * ChangeLog:
2258         * JavaScriptCore.pbproj/project.pbxproj:
2259         * bindings/objc/WebScriptObject.h: Added.
2260         * bindings/objc/WebScriptObject.mm: Added.
2261         (+[WebScriptObject throwException:]):
2262         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2263         (-[WebScriptObject evaluateWebScript:]):
2264         (-[WebScriptObject stringRepresentation]):
2265         (+[WebUndefined undefined]):
2266         (-[WebUndefined initWithCoder:]):
2267         (-[WebUndefined encodeWithCoder:]):
2268         (-[WebUndefined copyWithZone:]):
2269
2270 2004-05-07  Vicki Murley  <vicki@apple.com>
2271
2272         Reviewed by darin.
2273
2274         Turn off GC since it uses ppc only instructions (which breaks 
2275         the B&I build).   
2276     
2277         * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2278
2279 === Safari-139 ===
2280
2281 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
2282
2283         Reviewed by Darin.
2284
2285         - add -funroll-loops=16 compiler option for approx .5% speedup on
2286         HTML iBench and .5-1% speedup on JS iBench.
2287         
2288         * JavaScriptCore.pbproj/project.pbxproj:
2289
2290 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
2291
2292         Reviewed by Darin.
2293
2294         Enable full conservative GC mode in addition to test mode. When
2295         conservative GC is enabled, we now get an 11% speed improvement on
2296         the iBench. Also fix some spots I missed before.
2297
2298         Specific noteworth changes:
2299         
2300         * kjs/collector.cpp:
2301         (KJS::Collector::markStackObjectsConservatively): Check possible
2302         cell pointers for 8-byte aligment and verify they are not 0.
2303
2304         * kjs/protected_values.cpp:
2305         (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2306         (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2307         * kjs/protect.h:
2308         (KJS::gcProtectNullTolerant): ...to here...
2309         (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2310         tolerance, and doing the check is expensive.
2311
2312         * kjs/protected_values.cpp:
2313         (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2314         that is still very good.
2315
2316         * kjs/protect.h:
2317         (KJS::gcProtect):
2318         (KJS::gcUnprotect):
2319         (KJS::ProtectedValue::ProtectedValue):
2320         (KJS::ProtectedValue::~ProtectedValue):
2321         (KJS::ProtectedValue::operator=):
2322         (KJS::ProtectedObject::ProtectedObject):
2323         (KJS::ProtectedObject::~ProtectedObject):
2324         (KJS::ProtectedObject::operator=):
2325         (KJS::ProtectedReference::ProtectedReference):
2326         (KJS::ProtectedReference::~ProtectedReference):
2327         (KJS::ProtectedReference::operator=):
2328         * kjs/protected_values.cpp:
2329         (KJS::ProtectedValues::getProtectCount):
2330         (KJS::ProtectedValues::increaseProtectCount):
2331         (KJS::ProtectedValues::decreaseProtectCount):
2332         (KJS::ProtectedValues::computeHash):
2333         * bindings/runtime_root.cpp:
2334         (KJS::Bindings::addNativeReference):
2335         (KJS::Bindings::removeNativeReference):
2336         (RootObject::removeAllNativeReferences):
2337         * bindings/runtime_root.h:
2338         (KJS::Bindings::RootObject::~RootObject):
2339         (KJS::Bindings::RootObject::setRootObjectImp):
2340         * kjs/collector.cpp:
2341         (KJS::Collector::allocate):
2342         (KJS::Collector::collect):
2343         * kjs/collector.h:
2344         * kjs/internal.cpp:
2345         (NumberImp::create):
2346         (InterpreterImp::globalInit):
2347         (InterpreterImp::globalClear):
2348         (InterpreterImp::mark):
2349         * kjs/list.cpp:
2350         (KJS::List::derefValues):
2351         (KJS::List::refValues):
2352         (KJS::List::append):
2353         * kjs/object.cpp:
2354         (KJS::ObjectImp::setInternalValue):
2355         (KJS::ObjectImp::putDirect):
2356         * kjs/value.cpp:
2357         (ValueImp::mark):
2358         (ValueImp::marked):
2359         * kjs/value.h:
2360         (KJS::ValueImp::ValueImp):
2361         (KJS::ValueImp::~ValueImp):
2362         (KJS::ValueImp::):
2363         (KJS::Value::Value):
2364         (KJS::Value::~Value):
2365         (KJS::Value::operator=):
2366
2367 2004-04-30  Richard Williamson   <rjw@apple.com>
2368
2369         Asking an NSInvocation for it's return value when return type
2370         is void throws an exception.  Added check for void return types
2371         to avoid this exception.
2372
2373         Reviewed by Ken.
2374
2375         * bindings/objc/objc_instance.mm:
2376         (ObjcInstance::invokeMethod):
2377
2378 2004-04-29  Richard Williamson   <rjw@apple.com>
2379
2380         Fixed several bad problems with the ObjC bindings.  In particular, conversion
2381         to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2382
2383         Reviewed by Chris.
2384
2385         * bindings/objc/objc_jsobject.h:
2386         * bindings/objc/objc_jsobject.mm:
2387         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2388         (-[JavaScriptObject KJS::]):
2389         (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2390         (-[JavaScriptObject call:arguments:]):
2391         (-[JavaScriptObject evaluate:]):
2392         (-[JavaScriptObject getMember:]):
2393         (-[JavaScriptObject getSlot:]):
2394         * bindings/objc/objc_runtime.mm:
2395         (ObjcField::valueFromInstance):
2396         (ObjcField::setValueToInstance):
2397         * bindings/objc/objc_utility.mm:
2398         (KJS::Bindings::convertValueToObjcValue):
2399         (KJS::Bindings::convertObjcValueToValue):
2400         * bindings/runtime.h:
2401         * bindings/runtime_root.cpp:
2402         (KJS::Bindings::rootForInterpreter):
2403         (KJS::Bindings::addNativeReference):
2404         (KJS::Bindings::removeNativeReference):
2405         * bindings/runtime_root.h:
2406         * bindings/testbindings.mm:
2407         (-[MyFirstInterface logMessage:]):
2408         (-[MyFirstInterface setJSObject:]):
2409         (-[MyFirstInterface callJSObject::]):
2410
2411 2004-04-24  Darin Adler  <darin@apple.com>
2412
2413         Reviewed by Dave.
2414
2415         * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2416         that is 2x too big.
2417
2418 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
2419
2420         Reviewed by Darin.
2421
2422         Implementation of conservative GC, based partly on code from
2423         Darin. It's turned off for now, so it shouldn't have any effect on
2424         the normal build.
2425         
2426         * JavaScriptCore.pbproj/project.pbxproj:
2427         * kjs/collector.cpp:
2428         (KJS::Collector::markStackObjectsConservatively):
2429         (KJS::Collector::markProtectedObjects):
2430         (KJS::Collector::collect):
2431         * kjs/collector.h:
2432         * kjs/protect.h:
2433         (KJS::gcProtect):
2434         (KJS::gcUnprotect):
2435         * kjs/protected_values.cpp: Added.
2436         (KJS::ProtectedValues::getProtectCount):
2437         (KJS::ProtectedValues::increaseProtectCount):
2438         (KJS::ProtectedValues::insert):
2439         (KJS::ProtectedValues::decreaseProtectCount):
2440         (KJS::ProtectedValues::expand):
2441         (KJS::ProtectedValues::shrink):
2442         (KJS::ProtectedValues::rehash):
2443         (KJS::ProtectedValues::computeHash):
2444         * kjs/protected_values.h: Added.
2445         * kjs/value.cpp:
2446         (ValueImp::useConservativeMark):
2447         (ValueImp::mark):
2448         (ValueImp::marked):
2449         * kjs/value.h:
2450         (KJS::ValueImp::):
2451
2452 === Safari-138 ===
2453
2454 2004-04-22  Richard Williamson   <rjw@apple.com>
2455
2456         Fixed build snafu (re-declaration of NPBool in npruntime.h and
2457         npapi.h).
2458
2459         * bindings/npruntime.h:
2460
2461 2004-04-22  Richard Williamson   <rjw@apple.com>
2462
2463         Updated plugin binding API to reflect latest revision from
2464         working group.
2465         
2466         Biggest change is the introduction of NPVariant used to represent
2467         value types.  NPVariant replaces the use of NPObject for the
2468         exchange of values between scripting environment and native code.
2469
2470         Reviewed by John.
2471
2472         * JavaScriptCore.pbproj/project.pbxproj:
2473         * bindings/NP_jsobject.cpp:
2474         (identiferFromNPIdentifier):
2475         (NPN_Call):
2476         (NPN_Evaluate):
2477         (NPN_GetProperty):
2478         (NPN_SetProperty):
2479         (NPN_ToString):
2480         (NPN_GetPropertyAtIndex):
2481         (NPN_SetPropertyAtIndex):
2482         * bindings/c/c_class.cpp:
2483         (CClass::methodsNamed):
2484         (CClass::fieldNamed):
2485         * bindings/c/c_instance.cpp:
2486         (CInstance::invokeMethod):
2487         (CInstance::defaultValue):
2488         * bindings/c/c_runtime.cpp:
2489         (CField::valueFromInstance):
2490         (CField::setValueToInstance):
2491         * bindings/c/c_utility.cpp:
2492         (convertNPStringToUTF16):
2493         (convertUTF8ToUTF16):
2494         (coerceValueToNPVariantStringType):
2495         (convertValueToNPVariant):
2496         (convertNPVariantToValue):
2497         * bindings/c/c_utility.h:
2498         * bindings/npruntime.cpp:
2499         (NPN_GetIdentifier):
2500         (NPN_GetIdentifiers):
2501         (NPN_UTF8FromIdentifier):
2502         (NPN_VariantIsVoid):
2503         (NPN_VariantIsNull):
2504         (NPN_VariantIsUndefined):
2505         (NPN_VariantIsBool):
2506         (NPN_VariantIsInt32):
2507         (NPN_VariantIsDouble):
2508         (NPN_VariantIsString):
2509         (NPN_VariantIsObject):
2510         (NPN_VariantToBool):
2511         (NPN_VariantToString):
2512         (NPN_VariantToInt32):
2513         (NPN_VariantToDouble):
2514         (NPN_VariantToObject):
2515         (NPN_InitializeVariantAsVoid):
2516         (NPN_InitializeVariantAsNull):
2517         (NPN_InitializeVariantAsUndefined):
2518         (NPN_InitializeVariantWithBool):
2519         (NPN_InitializeVariantWithInt32):
2520         (NPN_InitializeVariantWithDouble):
2521         (NPN_InitializeVariantWithString):
2522         (NPN_InitializeVariantWithStringCopy):
2523         (NPN_InitializeVariantWithObject):
2524         (NPN_InitializeVariantWithVariant):
2525         (NPN_ReleaseVariantValue):
2526         (NPN_CreateObject):
2527         (NPN_RetainObject):
2528         (NPN_ReleaseObject):
2529         (NPN_IsKindOfClass):
2530         (NPN_SetExceptionWithUTF8):
2531         (NPN_SetException):
2532         * bindings/npruntime.h:
2533         (_NPString::):
2534         (_NPString::_NPVariant::):
2535         * bindings/testbindings.cpp:
2536         (logMessage):
2537         (setDoubleValue):
2538         (setIntValue):
2539         (setStringValue):
2540         (setBooleanValue):
2541         (getDoubleValue):
2542         (getIntValue):
2543         (getStringValue):
2544         (getBooleanValue):
2545         (myGetProperty):
2546         (mySetProperty):
2547         (myInvoke):
2548         (myAllocate):
2549
2550 2004-04-22  Darin Adler  <darin@apple.com>
2551
2552         Reviewed by Maciej.
2553
2554         - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2555
2556         * kjs/ustring.cpp:
2557         (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2558         Was resulting in a buffer 2x the needed size.
2559         (KJS::UString::expandPreCapacity): Ditto.
2560         (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2561
2562 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
2563
2564         Reviewed by Darin.
2565
2566         Preliminary change for conservative GC. Create "protected"
2567         subclasses to GC-protect objects when on heap, since we will soon
2568         remove the built-in refcounting of the normal wrapper classes. Use
2569         them where needed.
2570         
2571         * JavaScriptCore.pbproj/project.pbxproj:
2572         * kjs/context.h:
2573         * kjs/internal.h:
2574         (KJS::InterpreterImp::globalObject):
2575         * kjs/interpreter.h:
2576         * kjs/property_map.cpp:
2577         * kjs/reference.h:
2578         * kjs/reference_list.cpp:
2579
2580 2004-04-19  Maciej Stachowiak  <mjs@apple.com>
2581
2582         Reviewed by Dave.
2583
2584         Optimize prepend using the shared substring optimization. Also,
2585         limit the applicability of shared append and shared prepend. If
2586         you overdo it, it does more harm than good, because you create a
2587         bunch of strings that are disqualified from future shared
2588         append/prepend, for not much immediate savings in allocate/copy
2589         expense.
2590         
2591         * kjs/ustring.cpp:
2592         (KJS::):
2593         (KJS::UString::Rep::create):
2594         (KJS::UString::expandedSize):
2595         (KJS::UString::usedPreCapacity):
2596         (KJS::UString::expandCapacity):
2597         (KJS::UString::expandPreCapacity):
2598         (KJS::UString::UString):
2599         (KJS::UString::append):
2600         (KJS::UString::operator=):
2601         * kjs/ustring.h:
2602         (KJS::UString::Rep::data):
2603
2604 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
2605         Reviewed by Richard.
2606
2607         No more need for Completion or Reference to privately inherit from
2608         Value, none of the superclass functionality is used.
2609
2610         * kjs/completion.h:
2611         * kjs/reference.h:
2612
2613 === Safari-137 ===
2614
2615 2004-04-16  Richard Williamson   <rjw@apple.com>
2616
2617         Added interpreter lock protection around object creation.
2618
2619         Reviewed by Chris.
2620
2621         * bindings/runtime.cpp:
2622         (Instance::createRuntimeObject):
2623
2624 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
2625
2626         Reviewed by Ken.
2627
2628         Another JavaScript speed improvement: use the mechanism from
2629         string append optimization to make taking a substring fast, again
2630         sharing the buffer.
2631
2632         A further 22% improvement on the 24fun string speed test.
2633         
2634         * kjs/ustring.cpp:
2635         (KJS::):
2636         (KJS::UString::Rep::create):
2637         (KJS::UString::UString):
2638         (KJS::UString::append):
2639         (KJS::UString::operator=):
2640         (KJS::UString::substr):
2641         * kjs/ustring.h:
2642         (KJS::UString::Rep::data):
2643
2644 2004-04-13  Maciej Stachowiak  <mjs@apple.com>
2645
2646         Reviewed by Darin.
2647
2648         - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2649         - fixed <rdar://problem/3600691>: Table generation test is really slow
2650         - fixed <rdar://problem/3600661>: 24fun date test is really slow
2651
2652         80% speedup on the string test, lesser speedups on the other two.
2653         
2654         Two different optimizations here:
2655
2656         1) Avoid large overhead of scanning strings to see if they are all
2657         ASCII before numeric conversion.
2658         
2659         * kjs/nodes.cpp:
2660         (AssignNode::evaluate): Don't convert to integer until we know for
2661         sure the operation will need it. Attempting to convert strings to
2662         numbers is a waste when they are being appended with +=.
2663
2664         2) Avoid huge cost of appending strings.
2665
2666         This is done by allowing multiple strings to share a buffer but
2667         actually use different ranges of it. The first time a string is
2668         appended to, we start leaving at least 10% extra space in the
2669         buffer, so doing N appends to the same string takes O(log N)
2670         mallocs instead of O(N).
2671         
2672         * kjs/identifier.cpp:
2673         (KJS::Identifier::equal):
2674         (KJS::Identifier::add):
2675         * kjs/ustring.cpp:
2676         (KJS::):
2677         (KJS::UCharReference::operator=):
2678         (KJS::UCharReference::ref):
2679         (KJS::UString::Rep::create):
2680         (KJS::UString::Rep::destroy):
2681         (KJS::UString::expandedSize):
2682         (KJS::UString::usedCapacity):
2683         (KJS::UString::expandCapacity):
2684         (KJS::UString::UString):
2685         (KJS::UString::null):
2686         (KJS::UString::append):
2687         (KJS::UString::operator=):
2688         (KJS::UString::toStrictUInt32):
2689         (KJS::UString::detach):
2690         (KJS::KJS::operator==):
2691         * kjs/ustring.h:
2692         (KJS::UString::Rep::data):
2693         (KJS::UString::Rep::hash):
2694
2695 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2696
2697         Reviewed by John.
2698
2699         - fix deployment build by avoiding deployment-only warning.
2700
2701         * kjs/scope_chain.cpp:
2702         (KJS::ScopeChain::bottom):
2703
2704 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2705
2706         Reviewed by John.
2707
2708         Changed things so that newly created objects get a prototype based
2709         on the scope chain of the current function, rather than the
2710         interpreter that started execution. This fixes the following bugs:
2711         
2712         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2713         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2714
2715         * JavaScriptCore.pbproj/project.pbxproj:
2716         * kjs/array_object.cpp:
2717         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2718         (ArrayProtoFuncImp::ArrayProtoFuncImp):
2719         (ArrayProtoFuncImp::call):
2720         (ArrayObjectImp::construct):
2721         * kjs/bool_object.cpp:
2722         (BooleanObjectImp::construct):
2723         * kjs/date_object.cpp:
2724         (DateProtoFuncImp::DateProtoFuncImp):
2725         (DateProtoFuncImp::call):
2726         (DateObjectImp::construct):
2727         * kjs/error_object.cpp:
2728         (ErrorObjectImp::construct):
2729         * kjs/function.cpp:
2730         (FunctionImp::FunctionImp):
2731         (FunctionImp::call):
2732         (DeclaredFunctionImp::construct):
2733         (ArgumentsImp::ArgumentsImp):
2734         (GlobalFuncImp::call):
2735         * kjs/function_object.cpp:
2736         (FunctionProtoFuncImp::call):
2737         (FunctionObjectImp::construct):
2738         * kjs/internal.cpp:
2739         (BooleanImp::toObject):
2740         (StringImp::toObject):
2741         (NumberImp::toObject):
2742         (InterpreterImp::InterpreterImp):
2743         (InterpreterImp::clear):
2744         (InterpreterImp::interpreterWithGlobalObject):
2745         * kjs/internal.h:
2746         * kjs/interpreter.cpp:
2747         (ExecState::lexicalInterpreter):
2748         * kjs/interpreter.h:
2749         (KJS::ExecState::dynamicInterpreter):
2750         (KJS::ExecState::interpreter):
2751         * kjs/math_object.cpp:
2752         (MathFuncImp::MathFuncImp):
2753         * kjs/nodes.cpp:
2754         (StatementNode::hitStatement):
2755         (StatementNode::abortStatement):
2756         (RegExpNode::evaluate):
2757         (ElementNode::evaluate):
2758         (ArrayNode::evaluate):
2759         (ObjectLiteralNode::evaluate):
2760         (PropertyValueNode::evaluate):
2761         (FunctionCallNode::evaluate):
2762         (FuncDeclNode::processFuncDecl):
2763         (FuncExprNode::evaluate):
2764         * kjs/number_object.cpp:
2765         (NumberObjectImp::construct):
2766         * kjs/object.cpp:
2767         (KJS::ObjectImp::defaultValue):
2768         (KJS::Error::create):
2769         * kjs/object_object.cpp:
2770         (ObjectObjectImp::construct):
2771         * kjs/reference.cpp:
2772         (Reference::putValue):
2773         * kjs/regexp_object.cpp:
2774         (RegExpProtoFuncImp::call):
2775         (RegExpObjectImp::arrayOfMatches):
2776         (RegExpObjectImp::construct):
2777         * kjs/scope_chain.cpp:
2778         (KJS::ScopeChain::bottom):
2779         * kjs/scope_chain.h:
2780         * kjs/string_object.cpp:
2781         (StringProtoFuncImp::StringProtoFuncImp):
2782         (StringProtoFuncImp::call):
2783         (StringObjectImp::construct):
2784
2785 === Safari-136 ===
2786
2787 === Safari-135 ===
2788
2789 2004-03-31  Richard Williamson   <rjw@apple.com>
2790
2791         Tedious renames based on feedback from plugin-futures list.
2792         NP_ functions are renamed with NPN_ prefix.
2793         Types prefix renamed from NP_ to NP.
2794         NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated. 
2795         
2796         No review because this was just a renaming patch.
2797
2798         * bindings/NP_jsobject.cpp:
2799         (listFromNPArray):
2800         (jsAllocate):
2801         (identiferFromNPIdentifier):
2802         (NPN_Call):
2803         (NPN_Evaluate):
2804         (NPN_GetProperty):
2805         (NPN_SetProperty):
2806         (NPN_RemoveProperty):
2807         (NPN_ToString):
2808         (NPN_GetPropertyAtIndex):
2809         (NPN_SetPropertyAtIndex):
2810         * bindings/NP_jsobject.h:
2811         * bindings/c/c_class.cpp:
2812         (CClass::_commonInit):
2813         (CClass::classForIsA):
2814         (CClass::CClass):
2815         (CClass::methodsNamed):
2816         (CClass::fieldNamed):
2817         * bindings/c/c_class.h:
2818         * bindings/c/c_instance.cpp:
2819         (CInstance::CInstance):
2820         (CInstance::~CInstance):
2821         (CInstance::operator=):
2822         (CInstance::invokeMethod):
2823         (CInstance::defaultValue):
2824         * bindings/c/c_instance.h:
2825         (KJS::Bindings::CInstance::getObject):
2826         * bindings/c/c_runtime.cpp:
2827         (CField::valueFromInstance):
2828         (CField::setValueToInstance):
2829         * bindings/c/c_runtime.h:
2830         (KJS::Bindings::CField::CField):
2831         (KJS::Bindings::CField::name):
2832         (KJS::Bindings::CMethod::CMethod):
2833         (KJS::Bindings::CMethod::name):
2834         * bindings/c/c_utility.cpp:
2835         (coerceValueToNPString):
2836         (convertValueToNPValueType):
2837         (convertNPValueTypeToValue):
2838         * bindings/c/c_utility.h:
2839         * bindings/npruntime.cpp:
2840         (NPN_IdentifierFromUTF8):
2841         (NPN_IsValidIdentifier):
2842         (NPN_GetIdentifiers):
2843         (NPN_UTF8FromIdentifier):
2844         (NPN_CreateObject):
2845         (NPN_RetainObject):
2846         (NPN_ReleaseObject):
2847         (NPN_IsKindOfClass):
2848         (NPN_SetExceptionWithUTF8):
2849         (NPN_SetException):
2850         (numberAllocate):
2851         (NPN_CreateNumberWithInt):
2852         (NPN_CreateNumberWithFloat):
2853         (NPN_CreateNumberWithDouble):
2854         (NPN_IntFromNumber):
2855         (NPN_FloatFromNumber):
2856         (NPN_DoubleFromNumber):
2857         (stringAllocate):
2858         (NPN_CreateStringWithUTF8):
2859         (NPN_CreateStringWithUTF16):
2860         (NPN_DeallocateUTF8):
2861         (NPN_UTF8FromString):
2862         (NPN_UTF16FromString):
2863         (NPN_StringLength):
2864         (booleanAllocate):
2865         (NPN_CreateBoolean):
2866         (NPN_BoolFromBoolean):
2867         (nullAllocate):
2868         (NPN_GetNull):
2869         (undefinedAllocate):
2870         (NPN_GetUndefined):
2871         (arrayAllocate):
2872         (arrayDeallocate):
2873         (NPN_CreateArray):
2874         (NPN_CreateArrayV):
2875         (NPN_ObjectAtIndex):
2876         * bindings/npruntime.h:
2877         * bindings/runtime.cpp:
2878         (Instance::createBindingForLanguageInstance):
2879         * bindings/testbindings.cpp:
2880         (initializeIdentifiers):
2881         (myHasProperty):
2882         (myHasMethod):
2883         (myGetProperty):
2884         (mySetProperty):
2885         (logMessage):
2886         (setDoubleValue):
2887         (setIntValue):
2888         (setStringValue):
2889         (setBooleanValue):
2890         (getDoubleValue):
2891         (getIntValue):
2892         (getStringValue):
2893         (getBooleanValue):
2894         (myInvoke):
2895         (myAllocate):
2896         (myInvalidate):
2897         (myDeallocate):
2898         (main):
2899
2900 2004-03-31  Richard Williamson   <rjw@apple.com>
2901
2902         Changed references to NP_runtime.h to npruntime.h
2903         
2904         * JavaScriptCore.pbproj/project.pbxproj:
2905         * bindings/NP_jsobject.h:
2906         * bindings/c/c_class.h:
2907         * bindings/c/c_instance.h:
2908         * bindings/c/c_runtime.h:
2909         * bindings/c/c_utility.h:
2910         * bindings/npruntime.cpp:
2911
2912 2004-03-31  Richard Williamson   <rjw@apple.com>
2913
2914         Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2915
2916         * JavaScriptCore.pbproj/project.pbxproj:
2917         * bindings/NP_jsobject.h:
2918         * bindings/npruntime.cpp:
2919
2920 === Safari-134 ===
2921
2922 2004-03-23  Richard Williamson   <rjw@apple.com>
2923
2924         Added implementation of KJS::Value <-> NP_Object conversion functions.
2925         Augmented test program for 'C' bindings.
2926         Added asserts and parameter checking to all public API.        
2927
2928         Reviewed by Ken.
2929
2930         * JavaScriptCore.pbproj/project.pbxproj:
2931         * bindings/NP_jsobject.cpp:
2932         (NP_ToString):
2933         * bindings/NP_jsobject.h: Added.
2934         * bindings/NP_runtime.cpp:
2935         (NP_IdentifierFromUTF8):
2936         (NP_IsValidIdentifier):
2937         (NP_GetIdentifiers):
2938         (NP_CreateObject):
2939         (NP_RetainObject):
2940         (NP_ReleaseObject):
2941         (NP_IsKindOfClass):
2942         (NP_SetExceptionWithUTF8):
2943         (NP_SetException):
2944         (NP_IntFromNumber):
2945         (NP_FloatFromNumber):
2946         (NP_DoubleFromNumber):
2947         (NP_CreateStringWithUTF8):
2948         (NP_CreateStringWithUTF16):
2949         (NP_DeallocateUTF8):
2950         (NP_UTF8FromString):
2951         (NP_UTF16FromString):
2952         (NP_StringLength):
2953         (NP_BoolFromBoolean):
2954         * bindings/NP_runtime.h:
2955         * bindings/c/c_instance.cpp:
2956         (CInstance::invokeMethod):
2957         * bindings/c/c_utility.cpp:
2958         (coerceValueToNPString):
2959         (convertValueToNPValueType):
2960         (convertNPValueTypeToValue):
2961         * bindings/c/c_utility.h:
2962         * bindings/test.js:
2963         * bindings/testC.js: Added.
2964         * bindings/testbindings.cpp:
2965         (logMessage):
2966         (setDoubleValue):
2967         (setIntValue):
2968         (setStringValue):
2969         (setBooleanValue):
2970         (getDoubleValue):
2971         (getIntValue):
2972         (getStringValue):
2973         (getBooleanValue):
2974         (myInterfaceInvoke):
2975         (myInterfaceAllocate):
2976
2977 === Safari-133 ===
2978
2979 2004-03-19  Darin Adler  <darin@apple.com>
2980
2981         Reviewed by Ken.
2982
2983         - fixed problem with methods like setUTCHour
2984
2985         * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2986         GMT vs. local time function based on the utc flag.
2987
2988 2004-03-17  Richard Williamson   <rjw@apple.com>
2989
2990         Added a context parameter to result callbacks use by JavaScriptObject functions.  This was a change requested by Eric Carlson on the QT plugin team.
2991
2992         Reviewed by Ken.
2993
2994         * bindings/NP_jsobject.cpp:
2995         (NP_Call):
2996         (NP_Evaluate):
2997         (NP_GetProperty):
2998         (NP_ToString):
2999         (NP_GetPropertyAtIndex):
3000         * bindings/NP_runtime.h:
3001
3002 2004-03-16  Richard Williamson   <rjw@apple.com>
3003
3004         Fixed 3590169.  Regression (crash) caused by the switch to MethodLists.  Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
3005
3006         Reviewed by John.
3007
3008         * bindings/jni/jni_class.cpp:
3009         (JavaClass::methodsNamed):
3010
3011 2004-03-15  Richard Williamson   <rjw@apple.com>
3012
3013         Fixed 3570854.  Don't attempt to convert Null to strings.  We
3014         were incorrectly converting to "Null".
3015
3016         Actually fixed by Scott Kovatch.
3017
3018         Reviewed by Richard.
3019
3020         * bindings/jni/jni_utility.cpp:
3021         (KJS::Bindings::convertValueToJValue):
3022
3023 === Safari-132 ===
3024
3025 2004-03-11  Richard Williamson   <rjw@apple.com>
3026
3027         Stitched together the NP stuff to our language independent
3028         JavaScript binding stuff.  Very close to being done.
3029         
3030         Added program to test C bindings (and NP stuff).  Just tests
3031         properties.  Will add methods and JavaScript access, etc.
3032
3033         Updated Makefile.am to account for new bindings/c directory.
3034
3035         Change NP_UTF8 from "const char *" to "char" to allow for
3036         declarations like "const NP_UTF8 *" and "NP_UTF8 *".  Ditto
3037         for NP_UTF16.
3038
3039         Added NP_IsValidIdentifier().
3040
3041         Reviewed by Chris.
3042
3043         * JavaScriptCore.pbproj/project.pbxproj:
3044         * Makefile.am:
3045         * bindings/NP_jsobject.cpp:
3046         (identiferFromNPIdentifier):
3047         (NP_Evaluate):
3048         * bindings/NP_runtime.cpp:
3049         (NP_IdentifierFromUTF8):
3050         (NP_IsValidIdentifier):
3051         (NP_GetIdentifiers):
3052         (NP_UTF8FromIdentifier):
3053         (NP_SetExceptionWithUTF8):
3054         (NP_SetException):
3055         (NP_CreateStringWithUTF8):
3056         (NP_CreateStringWithUTF16):
3057         (NP_UTF8FromString):
3058         (NP_UTF16FromString):
3059         * bindings/NP_runtime.h:
3060         * bindings/c/c_class.cpp: Added.
3061         (CClass::_commonDelete):
3062         (CClass::_commonCopy):
3063         (CClass::_commonInit):
3064         (_createClassesByIsAIfNecessary):
3065         (CClass::classForIsA):
3066         (CClass::CClass):
3067         (CClass::name):
3068         (CClass::methodsNamed):
3069         (CClass::fieldNamed):
3070         * bindings/c/c_class.h: Added.
3071         (KJS::Bindings::CClass::~CClass):
3072         (KJS::Bindings::CClass::CClass):
3073         (KJS::Bindings::CClass::operator=):
3074         (KJS::Bindings::CClass::constructorAt):
3075         (KJS::Bindings::CClass::numConstructors):
3076         * bindings/c/c_instance.cpp: Added.
3077         (CInstance::CInstance):
3078         (CInstance::~CInstance):
3079         (CInstance::operator=):
3080         (CInstance::getClass):
3081         (CInstance::begin):
3082         (CInstance::end):
3083         (CInstance::invokeMethod):
3084         (CInstance::defaultValue):
3085         (CInstance::stringValue):
3086         (CInstance::numberValue):
3087         (CInstance::booleanValue):
3088         (CInstance::valueOf):
3089         * bindings/c/c_instance.h: Added.
3090         (KJS::Bindings::CInstance::getObject):
3091         * bindings/c/c_runtime.cpp: Added.
3092         (CField::valueFromInstance):
3093         (CField::setValueToInstance):
3094         * bindings/c/c_runtime.h: Added.
3095         (KJS::Bindings::CField::CField):
3096         (KJS::Bindings::CField::name):
3097         (KJS::Bindings::CField::type):
3098         (KJS::Bindings::CMethod::CMethod):
3099         (KJS::Bindings::CMethod::name):
3100         (KJS::Bindings::CMethod::numParameters):
3101         * bindings/c/c_utility.cpp: Added.
3102         (coerceValueToNPValueType):
3103         (convertValueToNPValueType):
3104         (convertNPValueTypeToValue):
3105         * bindings/c/c_utility.h: Added.
3106         * bindings/make_testbindings:
3107         * bindings/runtime.cpp:
3108         (Instance::createBindingForLanguageInstance):
3109         * bindings/runtime.h:
3110         (KJS::Bindings::Instance::):
3111         * bindings/testbindings.cpp: Added.
3112         (initializeIdentifiers):
3113         (myInterfaceHasProperty):
3114         (myInterfaceHasMethod):
3115         (myInterfaceGetProperty):
3116         (myInterfaceSetProperty):
3117         (myInterfaceInvoke):
3118         (myInterfaceAllocate):
3119         (myInterfaceInvalidate):
3120         (myInterfaceDeallocate):
3121         (GlobalImp::className):
3122         (readJavaScriptFromFile):
3123         (main):
3124
3125 2004-03-10  Richard Williamson   <rjw@apple.com>
3126
3127         Made changes to support new asychronous approach to calls from
3128         plugin to JavaScript
3129
3130         Reviewed by Chris.
3131
3132         * bindings/NP_jsobject.cpp:
3133         (NP_Call):
3134         (NP_Evaluate):
3135         (NP_GetProperty):
3136         (NP_ToString):
3137         (NP_GetPropertyAtIndex):
3138         * bindings/NP_runtime.h:
3139         * bindings/make_testbindings:
3140         * bindings/runtime.cpp:
3141         (Instance::createBindingForLanguageInstance):
3142
3143 2004-03-10  Richard Williamson   <rjw@apple.com>
3144
3145         Updated header to include proposed changes from
3146         plugin-futures list.  Calls from plugin to JavaScript
3147         are now asynchronous.
3148
3149         Reviewed by Chris.
3150
3151         * bindings/NP_runtime.h:
3152
3153 === Safari-131 ===
3154
3155 2004-03-04  Richard Williamson   <rjw@apple.com>
3156
3157         Implementation of NP_JavaScriptObject.  This is the 'C' class
3158         that wraps a JavaScript object.
3159
3160         Reviewed by Chris.
3161
3162         * JavaScriptCore.pbproj/project.pbxproj:
3163         * bindings/NP_jsobject.cpp: Added.
3164         (coerceValueToNPValueType):
3165         (convertValueToNPValueType):
3166         (convertNPValueTypeToValue):
3167         (listFromNPArray):
3168         (jsAllocate):
3169         (jsDeallocate):
3170         (identiferFromNPIdentifier):
3171         (NP_Call):
3172         (NP_Evaluate):
3173         (NP_GetProperty):
3174         (NP_SetProperty):
3175         (NP_RemoveProperty):
3176         (NP_ToString):
3177         (NP_GetPropertyAtIndex):
3178         (NP_SetPropertyAtIndex):
3179         * bindings/NP_runtime.cpp:
3180         (NP_ObjectAtIndex):
3181         * bindings/NP_runtime.h:
3182         * bindings/runtime_object.h:
3183
3184 2004-03-04  Richard Williamson   <rjw@apple.com>
3185
3186         Added NP_Array implementation.  
3187
3188         Changed NP_Boolean to just depend on two static instances, no
3189         space is required for values.
3190
3191         Reviewed by Chris.
3192
3193         * bindings/NP_runtime.cpp:
3194         (NP_CreateBoolean):
3195         (NP_BoolFromBoolean):
3196         (arrayAllocate):
3197         (arrayDeallocate):
3198         (NP_CreateArray):
3199         (NP_CreateArrayV):
3200         (NP_ObjectAtIndex):
3201         * bindings/NP_runtime.h:
3202
3203 2004-03-03  Darin Adler  <darin@apple.com>
3204
3205         Reviewed by Vicki.
3206
3207         * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3208         copyright string, and that's all that was in here.
3209         * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3210
3211 2004-03-03  Richard Williamson   <rjw@apple.com>
3212
3213         More 'C' binding implementation.  Fleshed out all the
3214         'primitive' data types.
3215
3216         Reviewed by Chris.
3217
3218         * bindings/NP_runtime.cpp:
3219         (NP_ReleaseObject):
3220         (numberAllocate):
3221         (stringAllocate):
3222         (stringDeallocate):
3223         (NP_CreateStringWithUTF8):
3224         (NP_CreateStringWithUTF16):
3225         (NP_UTF8FromString):
3226         (NP_UTF16FromString):
3227         (NP_StringLength):
3228         (booleanAllocate):
3229         (booleanDeallocate):
3230         (NP_CreateBoolean):
3231         (NP_BoolFromBoolean):
3232         (nullAllocate):
3233         (nullDeallocate):
3234         (NP_GetNull):
3235         (undefinedAllocate):
3236         (undefinedDeallocate):
3237         (NP_GetUndefined):
3238         * bindings/NP_runtime.h:
3239
3240 2004-03-03  Richard Williamson   <rjw@apple.com>
3241
3242         More 'C' binding implementation.
3243
3244         Reviewed by Chris.
3245
3246         * bindings/NP_runtime.cpp:
3247         (identifierEqual):
3248         (identifierHash):
3249         (getIdentifierDictionary):
3250         (NP_IdentifierFromUTF8):
3251         (NP_UTF8FromIdentifier):
3252         (NP_CreateObject):
3253         (NP_ReleaseObject):
3254         (NP_IsKindOfClass):
3255         (numberCreate):
3256         (NP_CreateNumberWithInt):
3257         (NP_CreateNumberWithFloat):
3258         (NP_CreateNumberWithDouble):
3259         (NP_IntFromNumber):
3260         (NP_FloatFromNumber):
3261         (NP_DoubleFromNumber):
3262         * bindings/NP_runtime.h:
3263
3264 2004-03-02  Richard Williamson   <rjw@apple.com>
3265
3266         Removed retain/release from NP_Class.  Classes will not be allowed to implement their
3267         own customer retain/release scheme.
3268
3269         Reviewed by Chris.
3270
3271         * bindings/NP_runtime.cpp:
3272         (NP_RetainObject):
3273         (NP_ReleaseObject):
3274         * bindings/NP_runtime.h:
3275
3276 2004-03-02  Richard Williamson   <rjw@apple.com>
3277
3278         C binding API.  Partial implementation.
3279
3280         Completed ObjectiveC bindings (not based on the C API).  These will re-implemented over the C binding API, but I wanted to get this code in the tree.
3281
3282         Factored root object reference counting scheme.  It is now useful independent
3283         of LiveConnect.
3284
3285         Reviewed by Chris.
3286
3287         * JavaScriptCore.pbproj/project.pbxproj:
3288         * bindings/NP_runtime.cpp: Added.
3289         (NP_IdentifierFromUTF8):
3290         (NP_GetIdentifiers):
3291         (NP_UTF8FromIdentifier):
3292         (NP_CreateObject):
3293         (NP_RetainObject):
3294         (NP_ReleaseObject):
3295         (NP_IsKindOfClass):
3296         (NP_SetException):
3297         (NP_Call):
3298         (NP_Evaluate):
3299         (NP_GetProperty):
3300         (NP_SetProperty):
3301         (NP_RemoveProperty):
3302         (NP_ToString):
3303         (NP_GetPropertyAtIndex):
3304         (NP_SetPropertyAtIndex):
3305         (NP_CreateNumberWithInt):
3306         (NP_CreateNumberWithFloat):
3307         (NP_CreateNumberWithDouble):
3308         (NP_IntFromNumber):
3309         (NP_FloatFromNumber):
3310         (NP_DoubleFromNumber):
3311         (NP_CreateStringWithUTF8):
3312         (NP_CreateStringWithUTF16):
3313         (NP_UTF8FromString):
3314         (NP_UTF16FromString):
3315         (NP_CreateBoolean):
3316         (NP_BoolFromBoolean):
3317         (NP_GetNull):
3318         (NP_GetUndefined):
3319         (NP_CreateArray):
3320         (NP_CreateArrayV):
3321         (NP_ObjectAtIndex):
3322         * bindings/NP_runtime.h: Added.
3323         * bindings/jni/jni_jsobject.cpp:
3324         (JSObject::invoke):
3325         (JSObject::finalize):
3326         (JSObject::createNative):
3327         (JSObject::convertValueToJObject):
3328         * bindings/jni/jni_jsobject.h:
3329         * bindings/objc/objc_jsobject.h:
3330         * bindings/objc/objc_jsobject.mm:
3331         (rootForView):
3332         (windowJavaScriptObject):
3333         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3334         (-[JavaScriptObject dealloc]):
3335         (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3336         (-[JavaScriptObject call:arguments:]):
3337         (-[JavaScriptObject evaluate:]):
3338         (-[JavaScriptObject getMember:]):
3339         (-[JavaScriptObject setMember:value:]):
3340         (-[JavaScriptObject removeMember:]):
3341         (-[JavaScriptObject toString]):
3342         (-[JavaScriptObject getSlot:]):
3343         (-[JavaScriptObject setSlot:value:]):
3344         * bindings/objc/objc_utility.h:
3345         * bindings/objc/objc_utility.mm:
3346         (KJS::Bindings::convertValueToObjcValue):
3347         * bindings/runtime_root.cpp: Added.
3348         (getReferencesByRootDictionary):
3349         (getReferencesDictionary):
3350         (KJS::Bindings::findReferenceDictionary):
3351         (KJS::Bindings::rootForImp):
3352         (KJS::Bindings::addNativeReference):
3353         (KJS::Bindings::removeNativeReference):
3354         (completedJavaScriptAccess):
3355         (initializeJavaScriptAccessLock):
3356         (lockJavaScriptAccess):
3357         (unlockJavaScriptAccess):
3358         (RootObject::dispatchToJavaScriptThread):
3359         (performJavaScriptAccess):
3360         (RootObject::setFindRootObjectForNativeHandleFunction):
3361         (RootObject::removeAllNativeReferences):
3362         * bindings/runtime_root.h: Added.
3363         (KJS::Bindings::RootObject::RootObject):
3364         (KJS::Bindings::RootObject::~RootObject):
3365         (KJS::Bindings::RootObject::setRootObjectImp):
3366         (KJS::Bindings::RootObject::rootObjectImp):
3367         (KJS::Bindings::RootObject::setInterpreter):
3368         (KJS::Bindings::RootObject::interpreter):
3369         (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3370         (KJS::Bindings::RootObject::runLoop):
3371         (KJS::Bindings::RootObject::performJavaScriptSource):
3372
3373 === Safari-130 ===
3374
3375 === Safari-129 ===
3376
3377 2004-02-18  Richard Williamson   <rjw@apple.com>
3378
3379         Added NSNumber/Number conversion.
3380
3381         Removed some unnecessary KJS:: namespace specifiers.
3382
3383         Reviewed by Ken.
3384
3385         * bindings/objc/objc_utility.mm:
3386         (KJS::Bindings::convertValueToObjcValue):
3387         (KJS::Bindings::convertObjcValueToValue):
3388         * bindings/runtime_array.h:
3389
3390 2004-02-18  Richard Williamson   <rjw@apple.com>
3391
3392         Added support for export NSArrays.
3393
3394         Updated valueAt() to take an ExecState so we can throw
3395         JS exceptions.
3396
3397         Implemented excludeSelectorFromJavaScript: in ObjcClass.  This allows
3398         ObjectiveC classes to control the visibility of their methods in 
3399         JavaScript.
3400
3401         Reviewed by Ken.
3402
3403         * bindings/jni/jni_runtime.cpp:
3404         (JavaField::valueFromInstance):
3405         (JavaArray::valueAt):
3406         * bindings/jni/jni_runtime.h:
3407         * bindings/objc/objc_class.mm:
3408         (ObjcClass::methodsNamed):
3409         * bindings/objc/objc_runtime.h:
3410         (KJS::Bindings::ObjcArray::getObjcArray):
3411         * bindings/objc/objc_runtime.mm:
3412         (ObjcField::valueFromInstance):
3413         (ObjcField::setValueToInstance):
3414         (ObjcArray::ObjcArray):
3415         (ObjcArray::~ObjcArray):
3416         (ObjcArray::operator=):
3417         (ObjcArray::setValueAt):
3418         (ObjcArray::valueAt):
3419         (ObjcArray::getLength):
3420         * bindings/objc/objc_utility.mm:
3421         (KJS::Bindings::convertValueToObjcValue):
3422         (KJS::Bindings::convertObjcValueToValue):
3423         * bindings/runtime.cpp:
3424         (Instance::getValueOfField):
3425         * bindings/runtime.h:
3426         * bindings/runtime_array.cpp:
3427         (RuntimeArrayImp::get):
3428         * bindings/runtime_object.cpp:
3429         (RuntimeObjectImp::get):
3430
3431 2004-02-17  Richard Williamson   <rjw@apple.com>
3432
3433         Added String <-> NSString conversion.
3434         Added tests of String <-> NSString conversion to test program.
3435
3436         Reviewed by Chris.
3437
3438         * bindings/objc/objc_utility.mm:
3439         (KJS::Bindings::convertValueToObjcValue):
3440         (KJS::Bindings::convertObjcValueToValue):
3441         * bindings/test.js:
3442         * bindings/testbindings.mm:
3443         (-[MyFirstInterface getString]):
3444
3445 2004-02-15  Darin Adler  <darin@apple.com>
3446
3447         Reviewed by Dave.
3448
3449         * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3450         and removing redundant settings of things that match defaults in other build styles.
3451
3452 2004-02-13  Richard Williamson   <rjw@apple.com>
3453
3454         Work towards the JavaScript ObjC bindings.  The bindings now work for 
3455         simple scalar types.  testbindings.mm is an illustration of how the 
3456         bindings work.
3457
3458         Reviewed by Ken.
3459
3460         * JavaScriptCore.pbproj/project.pbxproj:
3461         * Makefile.am:
3462         * bindings/jni/jni_class.cpp:
3463         (JavaClass::methodsNamed):
3464         * bindings/jni/jni_class.h:
3465         * bindings/jni/jni_instance.cpp:
3466         (JavaInstance::invokeMethod):
3467         * bindings/jni/jni_instance.h:
3468         * bindings/jni/jni_runtime.h:
3469         (KJS::Bindings::JavaMethod::returnType):
3470         * bindings/make_testbindings: Added.
3471         * bindings/objc/objc_class.h: Added.
3472         (KJS::Bindings::ObjcClass::~ObjcClass):
3473         (KJS::Bindings::ObjcClass::ObjcClass):
3474         (KJS::Bindings::ObjcClass::operator=):
3475         (KJS::Bindings::ObjcClass::constructorAt):
3476         (KJS::Bindings::ObjcClass::numConstructors):
3477         * bindings/objc/objc_class.mm: Added.
3478         (ObjcClass::_commonDelete):
3479         (ObjcClass::_commonCopy):
3480         (ObjcClass::_commonInit):
3481         (_createClassesByIsAIfNecessary):
3482         (ObjcClass::classForIsA):
3483         (ObjcClass::ObjcClass):
3484         (ObjcClass::name):
3485         (ObjcClass::methodsNamed):
3486         (ObjcClass::fieldNamed):
3487         * bindings/objc/objc_header.h: Added.
3488         * bindings/objc/objc_instance.h: Added.
3489         (KJS::Bindings::ObjcInstance::getObject):
3490         * bindings/objc/objc_instance.mm: Added.
3491         (ObjcInstance::ObjcInstance):
3492         (ObjcInstance::~ObjcInstance):
3493         (ObjcInstance::operator=):
3494         (ObjcInstance::begin):
3495         (ObjcInstance::end):
3496         (ObjcInstance::getClass):
3497         (ObjcInstance::invokeMethod):
3498         (ObjcInstance::defaultValue):
3499         (ObjcInstance::stringValue):
3500         (ObjcInstance::numberValue):
3501         (ObjcInstance::booleanValue):
3502         (ObjcInstance::valueOf):
3503         * bindings/objc/objc_jsobject.h: Added.
3504         * bindings/objc/objc_jsobject.mm: Added.
3505         * bindings/objc/objc_runtime.h:
3506         (KJS::Bindings::ObjcField::~ObjcField):
3507         (KJS::Bindings::ObjcField::ObjcField):
3508         (KJS::Bindings::ObjcField::operator=):
3509         (KJS::Bindings::ObjcMethod::ObjcMethod):
3510         (KJS::Bindings::ObjcMethod::~ObjcMethod):
3511         (KJS::Bindings::ObjcMethod::operator=):
3512         * bindings/objc/objc_runtime.mm: Added.
3513         (ObjcMethod::ObjcMethod):
3514         (ObjcMethod::name):
3515         (ObjcMethod::numParameters):
3516         (ObjcMethod::getMethodSignature):
3517         (ObjcField::ObjcField):
3518         (ObjcField::name):
3519         (ObjcField::type):
3520         (ObjcField::valueFromInstance):
3521         (ObjcField::setValueToInstance):
3522         * bindings/objc/objc_utility.h: Added.
3523         (KJS::Bindings::):
3524         * bindings/objc/objc_utility.mm: Added.
3525         (KJS::Bindings::JSMethodNameToObjCMethodName):
3526         (KJS::Bindings::convertValueToObjcValue):
3527         (KJS::Bindings::convertObjcValueToValue):
3528         (KJS::Bindings::objcValueTypeForType):
3529         * bindings/runtime.cpp:
3530         (MethodList::MethodList):
3531         (MethodList::operator=):
3532         (Instance::setValueOfField):
3533         (Instance::createBindingForLanguageInstance):
3534         (Instance::createRuntimeObject):
3535         * bindings/runtime.h:
3536         * bindings/runtime_method.cpp:
3537         (RuntimeMethodImp::RuntimeMethodImp):
3538         (RuntimeMethodImp::get):
3539         (RuntimeMethodImp::call):
3540         * bindings/runtime_method.h:
3541         * bindings/runtime_object.cpp:
3542         (RuntimeObjectImp::get):
3543         (RuntimeObjectImp::hasProperty):
3544         * bindings/test.js: Added.
3545         * bindings/testbindings.mm: Added.
3546         (-[MySecondInterface init]):
3547         (-[MyFirstInterface init]):
3548         (-[MyFirstInterface dealloc]):
3549         (+[MyFirstInterface JavaScriptNameForSelector:]):
3550         (-[MyFirstInterface getInt]):
3551         (-[MyFirstInterface setInt:]):
3552         (-[MyFirstInterface getMySecondInterface]):
3553         (-[MyFirstInterface logMessage:]):
3554         (GlobalImp::className):
3555         (readJavaScriptFromFile):
3556         (main):
3557
3558 === Safari-128 ===
3559
3560 2004-02-08  Darin Adler  <darin@apple.com>
3561
3562         Reviewed by Dave.
3563
3564         - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3565
3566         * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3567         macros from working right in C++ code that uses the <cctype> header.
3568
3569         * kjs/ustring.cpp:
3570         (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3571         (KJS::UTF8SequenceLengthNonASCII): Added.
3572         (KJS::inlineUTF8SequenceLength): Added.
3573         (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3574         (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3575         (KJS::createSortedOffsetsArray): Add special