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