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