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