6557d59f7bf23c5f8871a6927a42dcc2f3aeaea5
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2004-06-10  Kevin Decker  <kdecker@apple.com>
2
3         Reviewed by John.
4
5         * kjs/lexer.cpp: 
6         (Lexer::setCode):
7             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
8         * kjs/lexer.h:
9         (KJS::Lexer::lineNo):
10             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
11
12 === JavaScriptCore-143.2 ===
13
14 2004-06-07  Darin Adler  <darin@apple.com>
15
16         - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
17
18         * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
19         * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
20
21 === JavaScriptCore-143.1 ===
22
23 2004-06-04  Kevin Decker  <kdecker@apple.com>
24
25         Reviewed by Darin
26         
27         - fixed <rdar://problem/3680594>
28
29         * kjs/object.cpp:
30         (KJS::Error::create):
31
32 === Safari-143 ===
33
34 2004-06-04  Darin Adler  <darin@apple.com>
35
36         * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
37
38 2004-06-04  Kevin Decker  <kdecker@apple.com>
39
40         Reviewed by Dave.
41
42         - ObjC bindings do not (yet) pass along sourceurl or line numbers
43         - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
44         - changed the wording of an error message
45         - the lexer, parser, and interpreter have been made "sourceURL aware"
46         - stored the url into Error
47          
48         * bindings/NP_jsobject.cpp:
49         (NPN_Evaluate):
50         * bindings/jni/jni_jsobject.cpp:
51         (JSObject::eval):
52         * bindings/objc/WebScriptObject.mm:
53         (-[WebScriptObject evaluateWebScript:]):
54         * kjs/function.cpp:
55         (GlobalFuncImp::call):
56         * kjs/function_object.cpp:
57         (FunctionObjectImp::construct):
58         * kjs/internal.cpp:
59         (Parser::parse):
60         (InterpreterImp::checkSyntax):
61         (InterpreterImp::evaluate):
62         * kjs/internal.h:
63         * kjs/interpreter.cpp:
64         (Interpreter::evaluate):
65         * kjs/interpreter.h:
66         * kjs/lexer.cpp:
67         (Lexer::setCode):
68         * kjs/lexer.h:
69         (KJS::Lexer::sourceURL):
70         * kjs/nodes.cpp:
71         (Node::Node):
72         (Node::throwError):
73         (FunctionCallNode::evaluate):
74         * kjs/nodes.h:
75         * kjs/object.cpp:
76         (KJS::Error::create):
77         * kjs/object.h:
78
79 2004-06-04  Richard Williamson   <rjw@apple.com>
80
81         Fixed crash when attempting to access properties on nil
82         object.
83         
84         Reviewed by John.
85
86         * bindings/objc/objc_instance.mm:
87         (ObjcInstance::getClass):
88         * bindings/runtime_object.cpp:
89         (RuntimeObjectImp::get):
90         * bindings/testM.js:
91         * bindings/testbindings.mm:
92         (-[MyFirstInterface getString]):
93
94 2004-05-27  Kevin Decker  <kdecker@apple.com>
95
96         Reviewed by Ken.
97
98         -revised generated error message content
99         
100         * kjs/error_object.cpp:
101         (ErrorProtoFuncImp::call):
102         * kjs/internal.cpp:
103         (Parser::parse):
104         * kjs/object.cpp:
105         (KJS::Error::create):
106
107 === Safari-142 ===
108
109 2004-05-27  Richard Williamson   <rjw@apple.com>
110
111         Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
112
113         Reviewed by Chris.
114
115         * bindings/objc/WebScriptObject.h:
116
117 2004-05-27  Darin Adler  <darin@apple.com>
118
119         Reviewed by Maciej.
120
121         - moved to new symlink technique for embedding frameworks
122
123         * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
124         because we don't need it any more.
125
126 2004-05-24  Richard Williamson   <rjw@apple.com>
127
128         Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
129         fixed ClassInfo to correctly reflect inheritance.  This is required
130         because of the runtime checks in JSC for arrays, i.e. in
131         the Function objects apply method.
132
133         Reviewed by Ken.
134
135         * bindings/jni/jni_runtime.cpp:
136         (JavaArray::convertJObjectToArray):
137         * bindings/objc/objc_utility.mm:
138         (KJS::Bindings::convertObjcValueToValue):
139         * bindings/runtime_array.cpp:
140         (RuntimeArrayImp::RuntimeArrayImp):
141         * bindings/runtime_array.h:
142         * bindings/testM.js: Added.
143         * bindings/testbindings.mm:
144         (+[MyFirstInterface webScriptNameForSelector:]):
145         (-[MyFirstInterface logMessages:]):
146         (-[MyFirstInterface logMessage:prefix:]):
147         (-[MyFirstInterface callJSObject::]):
148
149 2004-05-22  Darin Adler  <darin@apple.com>
150
151         Reviewed by Maciej.
152
153         - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
154
155         * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
156         with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
157         CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
158         it hasn't been set explicitly.
159
160 === Safari-141 ===
161
162 2004-05-20  Richard Williamson   <rjw@apple.com>
163
164         Implemented WebScriptObject/DOM wrapper voodoo.  DOM wrappers
165         can now be referenced like any other WebScriptObject, meaning
166         you can do JS operations on them.
167
168         All added implementation of finalizeForWebScript.
169
170         Reviewed by Ken.
171
172         * bindings/objc/WebScriptObject.h:
173         * bindings/objc/WebScriptObject.mm:
174         (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
175         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
176         (-[WebScriptObject KJS::]):
177         (-[WebScriptObject dealloc]):
178         (-[WebScriptObject callWebScriptMethod:withArguments:]):
179         (-[WebScriptObject evaluateWebScript:]):
180         (-[WebScriptObject setValue:forKey:]):
181         (-[WebScriptObject valueForKey:]):
182         (-[WebScriptObject stringRepresentation]):
183         * bindings/objc/WebScriptObjectPrivate.h:
184         * bindings/objc/objc_instance.mm:
185         (ObjcInstance::~ObjcInstance):
186
187 2004-05-19  Richard Williamson   <rjw@apple.com>
188
189         Removed extraneous tabs that were added (by XCode?).
190
191         * bindings/objc/WebScriptObject.h:
192
193 2004-05-19  Darin Adler  <darin@apple.com>
194
195         - fixed headers with licenses mangled by Xcode auto-indenting
196
197         * bindings/jni/jni_jsobject.cpp:
198         * bindings/jni/jni_jsobject.h:
199         * bindings/runtime_array.h:
200         * bindings/runtime_root.cpp:
201         * bindings/runtime_root.h:
202
203 2004-05-18  Richard Williamson   <rjw@apple.com>
204
205         Added exception logging.  Also check for exception and
206         set results as appropriate.
207
208         Reviewed by Maciej (partially reviewed).
209
210         * bindings/objc/WebScriptObject.mm:
211         (-[WebScriptObject callWebScriptMethod:withArguments:]):
212         (-[WebScriptObject evaluateWebScript:]):
213         (-[WebScriptObject setValue:forKey:]):
214         (-[WebScriptObject valueForKey:]):
215
216 2004-05-18  Richard Williamson   <rjw@apple.com>
217
218         Finsished implementing support for windowScriptObject.
219         Had to make WebScriptObjectPrivate.h accessible from
220         WebCore.
221
222         Reviewed by Maciej.
223
224         * JavaScriptCore.pbproj/project.pbxproj:
225         * bindings/objc/WebScriptObjectPrivate.h:
226
227 2004-05-18  Richard Williamson   <rjw@apple.com>
228
229         Use KVC to set/get values instead of directly accessing
230         ivars.
231
232         Reviewed by Maciej.
233
234         * bindings/objc/WebScriptObject.mm:
235         (-[WebScriptObject callWebScriptMethod:withArguments:]):
236         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
237         * bindings/objc/objc_runtime.mm:
238         (ObjcField::valueFromInstance):
239         (convertValueToObjcObject):
240         (ObjcField::setValueToInstance):
241
242 2004-05-17  Richard Williamson   <rjw@apple.com>
243
244         Implemented new API for WebScriptObject.
245
246         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
247         Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object)  (w/ help from Vicki)
248
249         Reviewed by Hyatt.
250
251         * JavaScriptCore.pbproj/project.pbxproj:
252         * bindings/c/c_instance.cpp:
253         (CInstance::invokeMethod):
254         * bindings/jni/jni_instance.cpp:
255         (JavaInstance::invokeMethod):
256         * bindings/jni/jni_jsobject.cpp:
257         (JSObject::convertValueToJObject):
258         * bindings/jni/jni_utility.cpp:
259         (KJS::Bindings::getJNIField):
260         * bindings/objc/WebScriptObject.mm:
261         (_didExecute):
262         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
263         (-[WebScriptObject KJS::]):
264         (-[WebScriptObject dealloc]):
265         (+[WebScriptObject throwException:]):
266         (listFromNSArray):
267         (-[WebScriptObject callWebScriptMethod:withArguments:]):
268         (-[WebScriptObject evaluateWebScript:]):
269         (-[WebScriptObject setValue:forKey:]):
270         (-[WebScriptObject valueForKey:]):
271         (-[WebScriptObject stringRepresentation]):
272         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
273         (+[WebUndefined undefined]):
274         (-[WebUndefined initWithCoder:]):
275         (-[WebUndefined encodeWithCoder:]):
276         (-[WebUndefined copyWithZone:]):
277         (-[WebUndefined retain]):
278         (-[WebUndefined release]):
279         (-[WebUndefined retainCount]):
280         (-[WebUndefined autorelease]):
281         (-[WebUndefined dealloc]):
282         (-[WebUndefined copy]):
283         (-[WebUndefined replacementObjectForPortCoder:]):
284         * bindings/objc/WebScriptObjectPrivate.h: Added.
285         * bindings/objc/objc_class.mm:
286         (ObjcClass::methodsNamed):
287         (ObjcClass::fieldNamed):
288         * bindings/objc/objc_instance.mm:
289         (ObjcInstance::invokeMethod):
290         * bindings/objc/objc_jsobject.h:
291         * bindings/objc/objc_jsobject.mm:
292         * bindings/objc/objc_runtime.mm:
293         (ObjcField::valueFromInstance):
294         * bindings/objc/objc_utility.mm:
295         (KJS::Bindings::JSMethodNameToObjCMethodName):
296         (KJS::Bindings::convertValueToObjcValue):
297         (KJS::Bindings::convertObjcValueToValue):
298         * bindings/runtime.cpp:
299         (Instance::setDidExecuteFunction):
300         (Instance::didExecuteFunction):
301         (Instance::setValueOfField):
302         * bindings/runtime.h:
303         * bindings/testbindings.mm:
304         (+[MyFirstInterface webScriptNameForSelector:]):
305         (-[MyFirstInterface callJSObject::]):
306
307 2004-05-14  Vicki Murley  <vicki@apple.com>
308
309         Reviewed by mjs.
310  
311         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
312
313         * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
314
315 === Safari-140 ===
316
317 2004-05-13  Richard Williamson   <rjw@apple.com>
318
319         Fixed indentation.
320
321         Reviewed by Chris.
322
323         * ChangeLog:
324         * bindings/objc/WebScriptObject.h:
325
326 2004-05-13  Richard Williamson   <rjw@apple.com>
327
328         Approved API changes.  Currently unimplemented.
329
330         Reviewed by Chris.
331
332         * ChangeLog:
333         * JavaScriptCore.pbproj/project.pbxproj:
334         * bindings/objc/WebScriptObject.h: Added.
335         * bindings/objc/WebScriptObject.mm: Added.
336         (+[WebScriptObject throwException:]):
337         (-[WebScriptObject callWebScriptMethod:withArguments:]):
338         (-[WebScriptObject evaluateWebScript:]):
339         (-[WebScriptObject stringRepresentation]):
340         (+[WebUndefined undefined]):
341         (-[WebUndefined initWithCoder:]):
342         (-[WebUndefined encodeWithCoder:]):
343         (-[WebUndefined copyWithZone:]):
344
345 2004-05-07  Vicki Murley  <vicki@apple.com>
346
347         Reviewed by darin.
348
349         Turn off GC since it uses ppc only instructions (which breaks 
350         the B&I build).   
351     
352         * kjs/value.h: set USE_CONSERVATIVE_GC to 0
353
354 === Safari-139 ===
355
356 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
357
358         Reviewed by Darin.
359
360         - add -funroll-loops=16 compiler option for approx .5% speedup on
361         HTML iBench and .5-1% speedup on JS iBench.
362         
363         * JavaScriptCore.pbproj/project.pbxproj:
364
365 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
366
367         Reviewed by Darin.
368
369         Enable full conservative GC mode in addition to test mode. When
370         conservative GC is enabled, we now get an 11% speed improvement on
371         the iBench. Also fix some spots I missed before.
372
373         Specific noteworth changes:
374         
375         * kjs/collector.cpp:
376         (KJS::Collector::markStackObjectsConservatively): Check possible
377         cell pointers for 8-byte aligment and verify they are not 0.
378
379         * kjs/protected_values.cpp:
380         (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
381         (KJS::ProtectedValues::decreaseProtectCount): ...and here...
382         * kjs/protect.h:
383         (KJS::gcProtectNullTolerant): ...to here...
384         (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
385         tolerance, and doing the check is expensive.
386
387         * kjs/protected_values.cpp:
388         (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
389         that is still very good.
390
391         * kjs/protect.h:
392         (KJS::gcProtect):
393         (KJS::gcUnprotect):
394         (KJS::ProtectedValue::ProtectedValue):
395         (KJS::ProtectedValue::~ProtectedValue):
396         (KJS::ProtectedValue::operator=):
397         (KJS::ProtectedObject::ProtectedObject):
398         (KJS::ProtectedObject::~ProtectedObject):
399         (KJS::ProtectedObject::operator=):
400         (KJS::ProtectedReference::ProtectedReference):
401         (KJS::ProtectedReference::~ProtectedReference):
402         (KJS::ProtectedReference::operator=):
403         * kjs/protected_values.cpp:
404         (KJS::ProtectedValues::getProtectCount):
405         (KJS::ProtectedValues::increaseProtectCount):
406         (KJS::ProtectedValues::decreaseProtectCount):
407         (KJS::ProtectedValues::computeHash):
408         * bindings/runtime_root.cpp:
409         (KJS::Bindings::addNativeReference):
410         (KJS::Bindings::removeNativeReference):
411         (RootObject::removeAllNativeReferences):
412         * bindings/runtime_root.h:
413         (KJS::Bindings::RootObject::~RootObject):
414         (KJS::Bindings::RootObject::setRootObjectImp):
415         * kjs/collector.cpp:
416         (KJS::Collector::allocate):
417         (KJS::Collector::collect):
418         * kjs/collector.h:
419         * kjs/internal.cpp:
420         (NumberImp::create):
421         (InterpreterImp::globalInit):
422         (InterpreterImp::globalClear):
423         (InterpreterImp::mark):
424         * kjs/list.cpp:
425         (KJS::List::derefValues):
426         (KJS::List::refValues):
427         (KJS::List::append):
428         * kjs/object.cpp:
429         (KJS::ObjectImp::setInternalValue):
430         (KJS::ObjectImp::putDirect):
431         * kjs/value.cpp:
432         (ValueImp::mark):
433         (ValueImp::marked):
434         * kjs/value.h:
435         (KJS::ValueImp::ValueImp):
436         (KJS::ValueImp::~ValueImp):
437         (KJS::ValueImp::):
438         (KJS::Value::Value):
439         (KJS::Value::~Value):
440         (KJS::Value::operator=):
441
442 2004-04-30  Richard Williamson   <rjw@apple.com>
443
444         Asking an NSInvocation for it's return value when return type
445         is void throws an exception.  Added check for void return types
446         to avoid this exception.
447
448         Reviewed by Ken.
449
450         * bindings/objc/objc_instance.mm:
451         (ObjcInstance::invokeMethod):
452
453 2004-04-29  Richard Williamson   <rjw@apple.com>
454
455         Fixed several bad problems with the ObjC bindings.  In particular, conversion
456         to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
457
458         Reviewed by Chris.
459
460         * bindings/objc/objc_jsobject.h:
461         * bindings/objc/objc_jsobject.mm:
462         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
463         (-[JavaScriptObject KJS::]):
464         (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
465         (-[JavaScriptObject call:arguments:]):
466         (-[JavaScriptObject evaluate:]):
467         (-[JavaScriptObject getMember:]):
468         (-[JavaScriptObject getSlot:]):
469         * bindings/objc/objc_runtime.mm:
470         (ObjcField::valueFromInstance):
471         (ObjcField::setValueToInstance):
472         * bindings/objc/objc_utility.mm:
473         (KJS::Bindings::convertValueToObjcValue):
474         (KJS::Bindings::convertObjcValueToValue):
475         * bindings/runtime.h:
476         * bindings/runtime_root.cpp:
477         (KJS::Bindings::rootForInterpreter):
478         (KJS::Bindings::addNativeReference):
479         (KJS::Bindings::removeNativeReference):
480         * bindings/runtime_root.h:
481         * bindings/testbindings.mm:
482         (-[MyFirstInterface logMessage:]):
483         (-[MyFirstInterface setJSObject:]):
484         (-[MyFirstInterface callJSObject::]):
485
486 2004-04-24  Darin Adler  <darin@apple.com>
487
488         Reviewed by Dave.
489
490         * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
491         that is 2x too big.
492
493 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
494
495         Reviewed by Darin.
496
497         Implementation of conservative GC, based partly on code from
498         Darin. It's turned off for now, so it shouldn't have any effect on
499         the normal build.
500         
501         * JavaScriptCore.pbproj/project.pbxproj:
502         * kjs/collector.cpp:
503         (KJS::Collector::markStackObjectsConservatively):
504         (KJS::Collector::markProtectedObjects):
505         (KJS::Collector::collect):
506         * kjs/collector.h:
507         * kjs/protect.h:
508         (KJS::gcProtect):
509         (KJS::gcUnprotect):
510         * kjs/protected_values.cpp: Added.
511         (KJS::ProtectedValues::getProtectCount):
512         (KJS::ProtectedValues::increaseProtectCount):
513         (KJS::ProtectedValues::insert):
514         (KJS::ProtectedValues::decreaseProtectCount):
515         (KJS::ProtectedValues::expand):
516         (KJS::ProtectedValues::shrink):
517         (KJS::ProtectedValues::rehash):
518         (KJS::ProtectedValues::computeHash):
519         * kjs/protected_values.h: Added.
520         * kjs/value.cpp:
521         (ValueImp::useConservativeMark):
522         (ValueImp::mark):
523         (ValueImp::marked):
524         * kjs/value.h:
525         (KJS::ValueImp::):
526
527 === Safari-138 ===
528
529 2004-04-22  Richard Williamson   <rjw@apple.com>
530
531         Fixed build snafu (re-declaration of NPBool in npruntime.h and
532         npapi.h).
533
534         * bindings/npruntime.h:
535
536 2004-04-22  Richard Williamson   <rjw@apple.com>
537
538         Updated plugin binding API to reflect latest revision from
539         working group.
540         
541         Biggest change is the introduction of NPVariant used to represent
542         value types.  NPVariant replaces the use of NPObject for the
543         exchange of values between scripting environment and native code.
544
545         Reviewed by John.
546
547         * JavaScriptCore.pbproj/project.pbxproj:
548         * bindings/NP_jsobject.cpp:
549         (identiferFromNPIdentifier):
550         (NPN_Call):
551         (NPN_Evaluate):
552         (NPN_GetProperty):
553         (NPN_SetProperty):
554         (NPN_ToString):
555         (NPN_GetPropertyAtIndex):
556         (NPN_SetPropertyAtIndex):
557         * bindings/c/c_class.cpp:
558         (CClass::methodsNamed):
559         (CClass::fieldNamed):
560         * bindings/c/c_instance.cpp:
561         (CInstance::invokeMethod):
562         (CInstance::defaultValue):
563         * bindings/c/c_runtime.cpp:
564         (CField::valueFromInstance):
565         (CField::setValueToInstance):
566         * bindings/c/c_utility.cpp:
567         (convertNPStringToUTF16):
568         (convertUTF8ToUTF16):
569         (coerceValueToNPVariantStringType):
570         (convertValueToNPVariant):
571         (convertNPVariantToValue):
572         * bindings/c/c_utility.h:
573         * bindings/npruntime.cpp:
574         (NPN_GetIdentifier):
575         (NPN_GetIdentifiers):
576         (NPN_UTF8FromIdentifier):
577         (NPN_VariantIsVoid):
578         (NPN_VariantIsNull):
579         (NPN_VariantIsUndefined):
580         (NPN_VariantIsBool):
581         (NPN_VariantIsInt32):
582         (NPN_VariantIsDouble):
583         (NPN_VariantIsString):
584         (NPN_VariantIsObject):
585         (NPN_VariantToBool):
586         (NPN_VariantToString):
587         (NPN_VariantToInt32):
588         (NPN_VariantToDouble):
589         (NPN_VariantToObject):
590         (NPN_InitializeVariantAsVoid):
591         (NPN_InitializeVariantAsNull):
592         (NPN_InitializeVariantAsUndefined):
593         (NPN_InitializeVariantWithBool):
594         (NPN_InitializeVariantWithInt32):
595         (NPN_InitializeVariantWithDouble):
596         (NPN_InitializeVariantWithString):
597         (NPN_InitializeVariantWithStringCopy):
598         (NPN_InitializeVariantWithObject):
599         (NPN_InitializeVariantWithVariant):
600         (NPN_ReleaseVariantValue):
601         (NPN_CreateObject):
602         (NPN_RetainObject):
603         (NPN_ReleaseObject):
604         (NPN_IsKindOfClass):
605         (NPN_SetExceptionWithUTF8):
606         (NPN_SetException):
607         * bindings/npruntime.h:
608         (_NPString::):
609         (_NPString::_NPVariant::):
610         * bindings/testbindings.cpp:
611         (logMessage):
612         (setDoubleValue):
613         (setIntValue):
614         (setStringValue):
615         (setBooleanValue):
616         (getDoubleValue):
617         (getIntValue):
618         (getStringValue):
619         (getBooleanValue):
620         (myGetProperty):
621         (mySetProperty):
622         (myInvoke):
623         (myAllocate):
624
625 2004-04-22  Darin Adler  <darin@apple.com>
626
627         Reviewed by Maciej.
628
629         - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
630
631         * kjs/ustring.cpp:
632         (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
633         Was resulting in a buffer 2x the needed size.
634         (KJS::UString::expandPreCapacity): Ditto.
635         (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
636
637 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
638
639         Reviewed by Darin.
640
641         Preliminary change for conservative GC. Create "protected"
642         subclasses to GC-protect objects when on heap, since we will soon
643         remove the built-in refcounting of the normal wrapper classes. Use
644         them where needed.
645         
646         * JavaScriptCore.pbproj/project.pbxproj:
647         * kjs/context.h:
648         * kjs/internal.h:
649         (KJS::InterpreterImp::globalObject):
650         * kjs/interpreter.h:
651         * kjs/property_map.cpp:
652         * kjs/reference.h:
653         * kjs/reference_list.cpp:
654
655 2004-04-19  Maciej Stachowiak  <mjs@apple.com>
656
657         Reviewed by Dave.
658
659         Optimize prepend using the shared substring optimization. Also,
660         limit the applicability of shared append and shared prepend. If
661         you overdo it, it does more harm than good, because you create a
662         bunch of strings that are disqualified from future shared
663         append/prepend, for not much immediate savings in allocate/copy
664         expense.
665         
666         * kjs/ustring.cpp:
667         (KJS::):
668         (KJS::UString::Rep::create):
669         (KJS::UString::expandedSize):
670         (KJS::UString::usedPreCapacity):
671         (KJS::UString::expandCapacity):
672         (KJS::UString::expandPreCapacity):
673         (KJS::UString::UString):
674         (KJS::UString::append):
675         (KJS::UString::operator=):
676         * kjs/ustring.h:
677         (KJS::UString::Rep::data):
678
679 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
680         Reviewed by Richard.
681
682         No more need for Completion or Reference to privately inherit from
683         Value, none of the superclass functionality is used.
684
685         * kjs/completion.h:
686         * kjs/reference.h:
687
688 === Safari-137 ===
689
690 2004-04-16  Richard Williamson   <rjw@apple.com>
691
692         Added interpreter lock protection around object creation.
693
694         Reviewed by Chris.
695
696         * bindings/runtime.cpp:
697         (Instance::createRuntimeObject):
698
699 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
700
701         Reviewed by Ken.
702
703         Another JavaScript speed improvement: use the mechanism from
704         string append optimization to make taking a substring fast, again
705         sharing the buffer.
706
707         A further 22% improvement on the 24fun string speed test.
708         
709         * kjs/ustring.cpp:
710         (KJS::):
711         (KJS::UString::Rep::create):
712         (KJS::UString::UString):
713         (KJS::UString::append):
714         (KJS::UString::operator=):
715         (KJS::UString::substr):
716         * kjs/ustring.h:
717         (KJS::UString::Rep::data):
718
719 2004-04-13  Maciej Stachowiak  <mjs@apple.com>
720
721         Reviewed by Darin.
722
723         - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
724         - fixed <rdar://problem/3600691>: Table generation test is really slow
725         - fixed <rdar://problem/3600661>: 24fun date test is really slow
726
727         80% speedup on the string test, lesser speedups on the other two.
728         
729         Two different optimizations here:
730
731         1) Avoid large overhead of scanning strings to see if they are all
732         ASCII before numeric conversion.
733         
734         * kjs/nodes.cpp:
735         (AssignNode::evaluate): Don't convert to integer until we know for
736         sure the operation will need it. Attempting to convert strings to
737         numbers is a waste when they are being appended with +=.
738
739         2) Avoid huge cost of appending strings.
740
741         This is done by allowing multiple strings to share a buffer but
742         actually use different ranges of it. The first time a string is
743         appended to, we start leaving at least 10% extra space in the
744         buffer, so doing N appends to the same string takes O(log N)
745         mallocs instead of O(N).
746         
747         * kjs/identifier.cpp:
748         (KJS::Identifier::equal):
749         (KJS::Identifier::add):
750         * kjs/ustring.cpp:
751         (KJS::):
752         (KJS::UCharReference::operator=):
753         (KJS::UCharReference::ref):
754         (KJS::UString::Rep::create):
755         (KJS::UString::Rep::destroy):
756         (KJS::UString::expandedSize):
757         (KJS::UString::usedCapacity):
758         (KJS::UString::expandCapacity):
759         (KJS::UString::UString):
760         (KJS::UString::null):
761         (KJS::UString::append):
762         (KJS::UString::operator=):
763         (KJS::UString::toStrictUInt32):
764         (KJS::UString::detach):
765         (KJS::KJS::operator==):
766         * kjs/ustring.h:
767         (KJS::UString::Rep::data):
768         (KJS::UString::Rep::hash):
769
770 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
771
772         Reviewed by John.
773
774         - fix deployment build by avoiding deployment-only warning.
775
776         * kjs/scope_chain.cpp:
777         (KJS::ScopeChain::bottom):
778
779 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
780
781         Reviewed by John.
782
783         Changed things so that newly created objects get a prototype based
784         on the scope chain of the current function, rather than the
785         interpreter that started execution. This fixes the following bugs:
786         
787         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
788         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
789
790         * JavaScriptCore.pbproj/project.pbxproj:
791         * kjs/array_object.cpp:
792         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
793         (ArrayProtoFuncImp::ArrayProtoFuncImp):
794         (ArrayProtoFuncImp::call):
795         (ArrayObjectImp::construct):
796         * kjs/bool_object.cpp:
797         (BooleanObjectImp::construct):
798         * kjs/date_object.cpp:
799         (DateProtoFuncImp::DateProtoFuncImp):
800         (DateProtoFuncImp::call):
801         (DateObjectImp::construct):
802         * kjs/error_object.cpp:
803         (ErrorObjectImp::construct):
804         * kjs/function.cpp:
805         (FunctionImp::FunctionImp):
806         (FunctionImp::call):
807         (DeclaredFunctionImp::construct):
808         (ArgumentsImp::ArgumentsImp):
809         (GlobalFuncImp::call):
810         * kjs/function_object.cpp:
811         (FunctionProtoFuncImp::call):
812         (FunctionObjectImp::construct):
813         * kjs/internal.cpp:
814         (BooleanImp::toObject):
815         (StringImp::toObject):
816         (NumberImp::toObject):
817         (InterpreterImp::InterpreterImp):
818         (InterpreterImp::clear):
819         (InterpreterImp::interpreterWithGlobalObject):
820         * kjs/internal.h:
821         * kjs/interpreter.cpp:
822         (ExecState::lexicalInterpreter):
823         * kjs/interpreter.h:
824         (KJS::ExecState::dynamicInterpreter):
825         (KJS::ExecState::interpreter):
826         * kjs/math_object.cpp:
827         (MathFuncImp::MathFuncImp):
828         * kjs/nodes.cpp:
829         (StatementNode::hitStatement):
830         (StatementNode::abortStatement):
831         (RegExpNode::evaluate):
832         (ElementNode::evaluate):
833         (ArrayNode::evaluate):
834         (ObjectLiteralNode::evaluate):
835         (PropertyValueNode::evaluate):
836         (FunctionCallNode::evaluate):
837         (FuncDeclNode::processFuncDecl):
838         (FuncExprNode::evaluate):
839         * kjs/number_object.cpp:
840         (NumberObjectImp::construct):
841         * kjs/object.cpp:
842         (KJS::ObjectImp::defaultValue):
843         (KJS::Error::create):
844         * kjs/object_object.cpp:
845         (ObjectObjectImp::construct):
846         * kjs/reference.cpp:
847         (Reference::putValue):
848         * kjs/regexp_object.cpp:
849         (RegExpProtoFuncImp::call):
850         (RegExpObjectImp::arrayOfMatches):
851         (RegExpObjectImp::construct):
852         * kjs/scope_chain.cpp:
853         (KJS::ScopeChain::bottom):
854         * kjs/scope_chain.h:
855         * kjs/string_object.cpp:
856         (StringProtoFuncImp::StringProtoFuncImp):
857         (StringProtoFuncImp::call):
858         (StringObjectImp::construct):
859
860 === Safari-136 ===
861
862 === Safari-135 ===
863
864 2004-03-31  Richard Williamson   <rjw@apple.com>
865
866         Tedious renames based on feedback from plugin-futures list.
867         NP_ functions are renamed with NPN_ prefix.
868         Types prefix renamed from NP_ to NP.
869         NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated. 
870         
871         No review because this was just a renaming patch.
872
873         * bindings/NP_jsobject.cpp:
874         (listFromNPArray):
875         (jsAllocate):
876         (identiferFromNPIdentifier):
877         (NPN_Call):
878         (NPN_Evaluate):
879         (NPN_GetProperty):
880         (NPN_SetProperty):
881         (NPN_RemoveProperty):
882         (NPN_ToString):
883         (NPN_GetPropertyAtIndex):
884         (NPN_SetPropertyAtIndex):
885         * bindings/NP_jsobject.h:
886         * bindings/c/c_class.cpp:
887         (CClass::_commonInit):
888         (CClass::classForIsA):
889         (CClass::CClass):
890         (CClass::methodsNamed):
891         (CClass::fieldNamed):
892         * bindings/c/c_class.h:
893         * bindings/c/c_instance.cpp:
894         (CInstance::CInstance):
895         (CInstance::~CInstance):
896         (CInstance::operator=):
897         (CInstance::invokeMethod):
898         (CInstance::defaultValue):
899         * bindings/c/c_instance.h:
900         (KJS::Bindings::CInstance::getObject):
901         * bindings/c/c_runtime.cpp:
902         (CField::valueFromInstance):
903         (CField::setValueToInstance):
904         * bindings/c/c_runtime.h:
905         (KJS::Bindings::CField::CField):
906         (KJS::Bindings::CField::name):
907         (KJS::Bindings::CMethod::CMethod):
908         (KJS::Bindings::CMethod::name):
909         * bindings/c/c_utility.cpp:
910         (coerceValueToNPString):
911         (convertValueToNPValueType):
912         (convertNPValueTypeToValue):
913         * bindings/c/c_utility.h:
914         * bindings/npruntime.cpp:
915         (NPN_IdentifierFromUTF8):
916         (NPN_IsValidIdentifier):
917         (NPN_GetIdentifiers):
918         (NPN_UTF8FromIdentifier):
919         (NPN_CreateObject):
920         (NPN_RetainObject):
921         (NPN_ReleaseObject):
922         (NPN_IsKindOfClass):
923         (NPN_SetExceptionWithUTF8):
924         (NPN_SetException):
925         (numberAllocate):
926         (NPN_CreateNumberWithInt):
927         (NPN_CreateNumberWithFloat):
928         (NPN_CreateNumberWithDouble):
929         (NPN_IntFromNumber):
930         (NPN_FloatFromNumber):
931         (NPN_DoubleFromNumber):
932         (stringAllocate):
933         (NPN_CreateStringWithUTF8):
934         (NPN_CreateStringWithUTF16):
935         (NPN_DeallocateUTF8):
936         (NPN_UTF8FromString):
937         (NPN_UTF16FromString):
938         (NPN_StringLength):
939         (booleanAllocate):
940         (NPN_CreateBoolean):
941         (NPN_BoolFromBoolean):
942         (nullAllocate):
943         (NPN_GetNull):
944         (undefinedAllocate):
945         (NPN_GetUndefined):
946         (arrayAllocate):
947         (arrayDeallocate):
948         (NPN_CreateArray):
949         (NPN_CreateArrayV):
950         (NPN_ObjectAtIndex):
951         * bindings/npruntime.h:
952         * bindings/runtime.cpp:
953         (Instance::createBindingForLanguageInstance):
954         * bindings/testbindings.cpp:
955         (initializeIdentifiers):
956         (myHasProperty):
957         (myHasMethod):
958         (myGetProperty):
959         (mySetProperty):
960         (logMessage):
961         (setDoubleValue):
962         (setIntValue):
963         (setStringValue):
964         (setBooleanValue):
965         (getDoubleValue):
966         (getIntValue):
967         (getStringValue):
968         (getBooleanValue):
969         (myInvoke):
970         (myAllocate):
971         (myInvalidate):
972         (myDeallocate):
973         (main):
974
975 2004-03-31  Richard Williamson   <rjw@apple.com>
976
977         Changed references to NP_runtime.h to npruntime.h
978         
979         * JavaScriptCore.pbproj/project.pbxproj:
980         * bindings/NP_jsobject.h:
981         * bindings/c/c_class.h:
982         * bindings/c/c_instance.h:
983         * bindings/c/c_runtime.h:
984         * bindings/c/c_utility.h:
985         * bindings/npruntime.cpp:
986
987 2004-03-31  Richard Williamson   <rjw@apple.com>
988
989         Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
990
991         * JavaScriptCore.pbproj/project.pbxproj:
992         * bindings/NP_jsobject.h:
993         * bindings/npruntime.cpp:
994
995 === Safari-134 ===
996
997 2004-03-23  Richard Williamson   <rjw@apple.com>
998
999         Added implementation of KJS::Value <-> NP_Object conversion functions.
1000         Augmented test program for 'C' bindings.
1001         Added asserts and parameter checking to all public API.        
1002
1003         Reviewed by Ken.
1004
1005         * JavaScriptCore.pbproj/project.pbxproj:
1006         * bindings/NP_jsobject.cpp:
1007         (NP_ToString):
1008         * bindings/NP_jsobject.h: Added.
1009         * bindings/NP_runtime.cpp:
1010         (NP_IdentifierFromUTF8):
1011         (NP_IsValidIdentifier):
1012         (NP_GetIdentifiers):
1013         (NP_CreateObject):
1014         (NP_RetainObject):
1015         (NP_ReleaseObject):
1016         (NP_IsKindOfClass):
1017         (NP_SetExceptionWithUTF8):
1018         (NP_SetException):
1019         (NP_IntFromNumber):
1020         (NP_FloatFromNumber):
1021         (NP_DoubleFromNumber):
1022         (NP_CreateStringWithUTF8):
1023         (NP_CreateStringWithUTF16):
1024         (NP_DeallocateUTF8):
1025         (NP_UTF8FromString):
1026         (NP_UTF16FromString):
1027         (NP_StringLength):
1028         (NP_BoolFromBoolean):
1029         * bindings/NP_runtime.h:
1030         * bindings/c/c_instance.cpp:
1031         (CInstance::invokeMethod):
1032         * bindings/c/c_utility.cpp:
1033         (coerceValueToNPString):
1034         (convertValueToNPValueType):
1035         (convertNPValueTypeToValue):
1036         * bindings/c/c_utility.h:
1037         * bindings/test.js:
1038         * bindings/testC.js: Added.
1039         * bindings/testbindings.cpp:
1040         (logMessage):
1041         (setDoubleValue):
1042         (setIntValue):
1043         (setStringValue):
1044         (setBooleanValue):
1045         (getDoubleValue):
1046         (getIntValue):
1047         (getStringValue):
1048         (getBooleanValue):
1049         (myInterfaceInvoke):
1050         (myInterfaceAllocate):
1051
1052 === Safari-133 ===
1053
1054 2004-03-19  Darin Adler  <darin@apple.com>
1055
1056         Reviewed by Ken.
1057
1058         - fixed problem with methods like setUTCHour
1059
1060         * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
1061         GMT vs. local time function based on the utc flag.
1062
1063 2004-03-17  Richard Williamson   <rjw@apple.com>
1064
1065         Added a context parameter to result callbacks use by JavaScriptObject functions.  This was a change requested by Eric Carlson on the QT plugin team.
1066
1067         Reviewed by Ken.
1068
1069         * bindings/NP_jsobject.cpp:
1070         (NP_Call):
1071         (NP_Evaluate):
1072         (NP_GetProperty):
1073         (NP_ToString):
1074         (NP_GetPropertyAtIndex):
1075         * bindings/NP_runtime.h:
1076
1077 2004-03-16  Richard Williamson   <rjw@apple.com>
1078
1079         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.
1080
1081         Reviewed by John.
1082
1083         * bindings/jni/jni_class.cpp:
1084         (JavaClass::methodsNamed):
1085
1086 2004-03-15  Richard Williamson   <rjw@apple.com>
1087
1088         Fixed 3570854.  Don't attempt to convert Null to strings.  We
1089         were incorrectly converting to "Null".
1090
1091         Actually fixed by Scott Kovatch.
1092
1093         Reviewed by Richard.
1094
1095         * bindings/jni/jni_utility.cpp:
1096         (KJS::Bindings::convertValueToJValue):
1097
1098 === Safari-132 ===
1099
1100 2004-03-11  Richard Williamson   <rjw@apple.com>
1101
1102         Stitched together the NP stuff to our language independent
1103         JavaScript binding stuff.  Very close to being done.
1104         
1105         Added program to test C bindings (and NP stuff).  Just tests
1106         properties.  Will add methods and JavaScript access, etc.
1107
1108         Updated Makefile.am to account for new bindings/c directory.
1109
1110         Change NP_UTF8 from "const char *" to "char" to allow for
1111         declarations like "const NP_UTF8 *" and "NP_UTF8 *".  Ditto
1112         for NP_UTF16.
1113
1114         Added NP_IsValidIdentifier().
1115
1116         Reviewed by Chris.
1117
1118         * JavaScriptCore.pbproj/project.pbxproj:
1119         * Makefile.am:
1120         * bindings/NP_jsobject.cpp:
1121         (identiferFromNPIdentifier):
1122         (NP_Evaluate):
1123         * bindings/NP_runtime.cpp:
1124         (NP_IdentifierFromUTF8):
1125         (NP_IsValidIdentifier):
1126         (NP_GetIdentifiers):
1127         (NP_UTF8FromIdentifier):
1128         (NP_SetExceptionWithUTF8):
1129         (NP_SetException):
1130         (NP_CreateStringWithUTF8):
1131         (NP_CreateStringWithUTF16):
1132         (NP_UTF8FromString):
1133         (NP_UTF16FromString):
1134         * bindings/NP_runtime.h:
1135         * bindings/c/c_class.cpp: Added.
1136         (CClass::_commonDelete):
1137         (CClass::_commonCopy):
1138         (CClass::_commonInit):
1139         (_createClassesByIsAIfNecessary):
1140         (CClass::classForIsA):
1141         (CClass::CClass):
1142         (CClass::name):
1143         (CClass::methodsNamed):
1144         (CClass::fieldNamed):
1145         * bindings/c/c_class.h: Added.
1146         (KJS::Bindings::CClass::~CClass):
1147         (KJS::Bindings::CClass::CClass):
1148         (KJS::Bindings::CClass::operator=):
1149         (KJS::Bindings::CClass::constructorAt):
1150         (KJS::Bindings::CClass::numConstructors):
1151         * bindings/c/c_instance.cpp: Added.
1152         (CInstance::CInstance):
1153         (CInstance::~CInstance):
1154         (CInstance::operator=):
1155         (CInstance::getClass):
1156         (CInstance::begin):
1157         (CInstance::end):
1158         (CInstance::invokeMethod):
1159         (CInstance::defaultValue):
1160         (CInstance::stringValue):
1161         (CInstance::numberValue):
1162         (CInstance::booleanValue):
1163         (CInstance::valueOf):
1164         * bindings/c/c_instance.h: Added.
1165         (KJS::Bindings::CInstance::getObject):
1166         * bindings/c/c_runtime.cpp: Added.
1167         (CField::valueFromInstance):
1168         (CField::setValueToInstance):
1169         * bindings/c/c_runtime.h: Added.
1170         (KJS::Bindings::CField::CField):
1171         (KJS::Bindings::CField::name):
1172         (KJS::Bindings::CField::type):
1173         (KJS::Bindings::CMethod::CMethod):
1174         (KJS::Bindings::CMethod::name):
1175         (KJS::Bindings::CMethod::numParameters):
1176         * bindings/c/c_utility.cpp: Added.
1177         (coerceValueToNPValueType):
1178         (convertValueToNPValueType):
1179         (convertNPValueTypeToValue):
1180         * bindings/c/c_utility.h: Added.
1181         * bindings/make_testbindings:
1182         * bindings/runtime.cpp:
1183         (Instance::createBindingForLanguageInstance):
1184         * bindings/runtime.h:
1185         (KJS::Bindings::Instance::):
1186         * bindings/testbindings.cpp: Added.
1187         (initializeIdentifiers):
1188         (myInterfaceHasProperty):
1189         (myInterfaceHasMethod):
1190         (myInterfaceGetProperty):
1191         (myInterfaceSetProperty):
1192         (myInterfaceInvoke):
1193         (myInterfaceAllocate):
1194         (myInterfaceInvalidate):
1195         (myInterfaceDeallocate):
1196         (GlobalImp::className):
1197         (readJavaScriptFromFile):
1198         (main):
1199
1200 2004-03-10  Richard Williamson   <rjw@apple.com>
1201
1202         Made changes to support new asychronous approach to calls from
1203         plugin to JavaScript
1204
1205         Reviewed by Chris.
1206
1207         * bindings/NP_jsobject.cpp:
1208         (NP_Call):
1209         (NP_Evaluate):
1210         (NP_GetProperty):
1211         (NP_ToString):
1212         (NP_GetPropertyAtIndex):
1213         * bindings/NP_runtime.h:
1214         * bindings/make_testbindings:
1215         * bindings/runtime.cpp:
1216         (Instance::createBindingForLanguageInstance):
1217
1218 2004-03-10  Richard Williamson   <rjw@apple.com>
1219
1220         Updated header to include proposed changes from
1221         plugin-futures list.  Calls from plugin to JavaScript
1222         are now asynchronous.
1223
1224         Reviewed by Chris.
1225
1226         * bindings/NP_runtime.h:
1227
1228 === Safari-131 ===
1229
1230 2004-03-04  Richard Williamson   <rjw@apple.com>
1231
1232         Implementation of NP_JavaScriptObject.  This is the 'C' class
1233         that wraps a JavaScript object.
1234
1235         Reviewed by Chris.
1236
1237         * JavaScriptCore.pbproj/project.pbxproj:
1238         * bindings/NP_jsobject.cpp: Added.
1239         (coerceValueToNPValueType):
1240         (convertValueToNPValueType):
1241         (convertNPValueTypeToValue):
1242         (listFromNPArray):
1243         (jsAllocate):
1244         (jsDeallocate):
1245         (identiferFromNPIdentifier):
1246         (NP_Call):
1247         (NP_Evaluate):
1248         (NP_GetProperty):
1249         (NP_SetProperty):
1250         (NP_RemoveProperty):
1251         (NP_ToString):
1252         (NP_GetPropertyAtIndex):
1253         (NP_SetPropertyAtIndex):
1254         * bindings/NP_runtime.cpp:
1255         (NP_ObjectAtIndex):
1256         * bindings/NP_runtime.h:
1257         * bindings/runtime_object.h:
1258
1259 2004-03-04  Richard Williamson   <rjw@apple.com>
1260
1261         Added NP_Array implementation.  
1262
1263         Changed NP_Boolean to just depend on two static instances, no
1264         space is required for values.
1265
1266         Reviewed by Chris.
1267
1268         * bindings/NP_runtime.cpp:
1269         (NP_CreateBoolean):
1270         (NP_BoolFromBoolean):
1271         (arrayAllocate):
1272         (arrayDeallocate):
1273         (NP_CreateArray):
1274         (NP_CreateArrayV):
1275         (NP_ObjectAtIndex):
1276         * bindings/NP_runtime.h:
1277
1278 2004-03-03  Darin Adler  <darin@apple.com>
1279
1280         Reviewed by Vicki.
1281
1282         * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
1283         copyright string, and that's all that was in here.
1284         * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
1285
1286 2004-03-03  Richard Williamson   <rjw@apple.com>
1287
1288         More 'C' binding implementation.  Fleshed out all the
1289         'primitive' data types.
1290
1291         Reviewed by Chris.
1292
1293         * bindings/NP_runtime.cpp:
1294         (NP_ReleaseObject):
1295         (numberAllocate):
1296         (stringAllocate):
1297         (stringDeallocate):
1298         (NP_CreateStringWithUTF8):
1299         (NP_CreateStringWithUTF16):
1300         (NP_UTF8FromString):
1301         (NP_UTF16FromString):
1302         (NP_StringLength):
1303         (booleanAllocate):
1304         (booleanDeallocate):
1305         (NP_CreateBoolean):
1306         (NP_BoolFromBoolean):
1307         (nullAllocate):
1308         (nullDeallocate):
1309         (NP_GetNull):
1310         (undefinedAllocate):
1311         (undefinedDeallocate):
1312         (NP_GetUndefined):
1313         * bindings/NP_runtime.h:
1314
1315 2004-03-03  Richard Williamson   <rjw@apple.com>
1316
1317         More 'C' binding implementation.
1318
1319         Reviewed by Chris.
1320
1321         * bindings/NP_runtime.cpp:
1322         (identifierEqual):
1323         (identifierHash):
1324         (getIdentifierDictionary):
1325         (NP_IdentifierFromUTF8):
1326         (NP_UTF8FromIdentifier):
1327         (NP_CreateObject):
1328         (NP_ReleaseObject):
1329         (NP_IsKindOfClass):
1330         (numberCreate):
1331         (NP_CreateNumberWithInt):
1332         (NP_CreateNumberWithFloat):
1333         (NP_CreateNumberWithDouble):
1334         (NP_IntFromNumber):
1335         (NP_FloatFromNumber):
1336         (NP_DoubleFromNumber):
1337         * bindings/NP_runtime.h:
1338
1339 2004-03-02  Richard Williamson   <rjw@apple.com>
1340
1341         Removed retain/release from NP_Class.  Classes will not be allowed to implement their
1342         own customer retain/release scheme.
1343
1344         Reviewed by Chris.
1345
1346         * bindings/NP_runtime.cpp:
1347         (NP_RetainObject):
1348         (NP_ReleaseObject):
1349         * bindings/NP_runtime.h:
1350
1351 2004-03-02  Richard Williamson   <rjw@apple.com>
1352
1353         C binding API.  Partial implementation.
1354
1355         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.
1356
1357         Factored root object reference counting scheme.  It is now useful independent
1358         of LiveConnect.
1359
1360         Reviewed by Chris.
1361
1362         * JavaScriptCore.pbproj/project.pbxproj:
1363         * bindings/NP_runtime.cpp: Added.
1364         (NP_IdentifierFromUTF8):
1365         (NP_GetIdentifiers):
1366         (NP_UTF8FromIdentifier):
1367         (NP_CreateObject):
1368         (NP_RetainObject):
1369         (NP_ReleaseObject):
1370         (NP_IsKindOfClass):
1371         (NP_SetException):
1372         (NP_Call):
1373         (NP_Evaluate):
1374         (NP_GetProperty):
1375         (NP_SetProperty):
1376         (NP_RemoveProperty):
1377         (NP_ToString):
1378         (NP_GetPropertyAtIndex):
1379         (NP_SetPropertyAtIndex):
1380         (NP_CreateNumberWithInt):
1381         (NP_CreateNumberWithFloat):
1382         (NP_CreateNumberWithDouble):
1383         (NP_IntFromNumber):
1384         (NP_FloatFromNumber):
1385         (NP_DoubleFromNumber):
1386         (NP_CreateStringWithUTF8):
1387         (NP_CreateStringWithUTF16):
1388         (NP_UTF8FromString):
1389         (NP_UTF16FromString):
1390         (NP_CreateBoolean):
1391         (NP_BoolFromBoolean):
1392         (NP_GetNull):
1393         (NP_GetUndefined):
1394         (NP_CreateArray):
1395         (NP_CreateArrayV):
1396         (NP_ObjectAtIndex):
1397         * bindings/NP_runtime.h: Added.
1398         * bindings/jni/jni_jsobject.cpp:
1399         (JSObject::invoke):
1400         (JSObject::finalize):
1401         (JSObject::createNative):
1402         (JSObject::convertValueToJObject):
1403         * bindings/jni/jni_jsobject.h:
1404         * bindings/objc/objc_jsobject.h:
1405         * bindings/objc/objc_jsobject.mm:
1406         (rootForView):
1407         (windowJavaScriptObject):
1408         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
1409         (-[JavaScriptObject dealloc]):
1410         (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
1411         (-[JavaScriptObject call:arguments:]):
1412         (-[JavaScriptObject evaluate:]):
1413         (-[JavaScriptObject getMember:]):
1414         (-[JavaScriptObject setMember:value:]):
1415         (-[JavaScriptObject removeMember:]):
1416         (-[JavaScriptObject toString]):
1417         (-[JavaScriptObject getSlot:]):
1418         (-[JavaScriptObject setSlot:value:]):
1419         * bindings/objc/objc_utility.h:
1420         * bindings/objc/objc_utility.mm:
1421         (KJS::Bindings::convertValueToObjcValue):
1422         * bindings/runtime_root.cpp: Added.
1423         (getReferencesByRootDictionary):
1424         (getReferencesDictionary):
1425         (KJS::Bindings::findReferenceDictionary):
1426         (KJS::Bindings::rootForImp):
1427         (KJS::Bindings::addNativeReference):
1428         (KJS::Bindings::removeNativeReference):
1429         (completedJavaScriptAccess):
1430         (initializeJavaScriptAccessLock):
1431         (lockJavaScriptAccess):
1432         (unlockJavaScriptAccess):
1433         (RootObject::dispatchToJavaScriptThread):
1434         (performJavaScriptAccess):
1435         (RootObject::setFindRootObjectForNativeHandleFunction):
1436         (RootObject::removeAllNativeReferences):
1437         * bindings/runtime_root.h: Added.
1438         (KJS::Bindings::RootObject::RootObject):
1439         (KJS::Bindings::RootObject::~RootObject):
1440         (KJS::Bindings::RootObject::setRootObjectImp):
1441         (KJS::Bindings::RootObject::rootObjectImp):
1442         (KJS::Bindings::RootObject::setInterpreter):
1443         (KJS::Bindings::RootObject::interpreter):
1444         (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
1445         (KJS::Bindings::RootObject::runLoop):
1446         (KJS::Bindings::RootObject::performJavaScriptSource):
1447
1448 === Safari-130 ===
1449
1450 === Safari-129 ===
1451
1452 2004-02-18  Richard Williamson   <rjw@apple.com>
1453
1454         Added NSNumber/Number conversion.
1455
1456         Removed some unnecessary KJS:: namespace specifiers.
1457
1458         Reviewed by Ken.
1459
1460         * bindings/objc/objc_utility.mm:
1461         (KJS::Bindings::convertValueToObjcValue):
1462         (KJS::Bindings::convertObjcValueToValue):
1463         * bindings/runtime_array.h:
1464
1465 2004-02-18  Richard Williamson   <rjw@apple.com>
1466
1467         Added support for export NSArrays.
1468
1469         Updated valueAt() to take an ExecState so we can throw
1470         JS exceptions.
1471
1472         Implemented excludeSelectorFromJavaScript: in ObjcClass.  This allows
1473         ObjectiveC classes to control the visibility of their methods in 
1474         JavaScript.
1475
1476         Reviewed by Ken.
1477
1478         * bindings/jni/jni_runtime.cpp:
1479         (JavaField::valueFromInstance):
1480         (JavaArray::valueAt):
1481         * bindings/jni/jni_runtime.h:
1482         * bindings/objc/objc_class.mm:
1483         (ObjcClass::methodsNamed):
1484         * bindings/objc/objc_runtime.h:
1485         (KJS::Bindings::ObjcArray::getObjcArray):
1486         * bindings/objc/objc_runtime.mm:
1487         (ObjcField::valueFromInstance):
1488         (ObjcField::setValueToInstance):
1489         (ObjcArray::ObjcArray):
1490         (ObjcArray::~ObjcArray):
1491         (ObjcArray::operator=):
1492         (ObjcArray::setValueAt):
1493         (ObjcArray::valueAt):
1494         (ObjcArray::getLength):
1495         * bindings/objc/objc_utility.mm:
1496         (KJS::Bindings::convertValueToObjcValue):
1497         (KJS::Bindings::convertObjcValueToValue):
1498         * bindings/runtime.cpp:
1499         (Instance::getValueOfField):
1500         * bindings/runtime.h:
1501         * bindings/runtime_array.cpp:
1502         (RuntimeArrayImp::get):
1503         * bindings/runtime_object.cpp:
1504         (RuntimeObjectImp::get):
1505
1506 2004-02-17  Richard Williamson   <rjw@apple.com>
1507
1508         Added String <-> NSString conversion.
1509         Added tests of String <-> NSString conversion to test program.
1510
1511         Reviewed by Chris.
1512
1513         * bindings/objc/objc_utility.mm:
1514         (KJS::Bindings::convertValueToObjcValue):
1515         (KJS::Bindings::convertObjcValueToValue):
1516         * bindings/test.js:
1517         * bindings/testbindings.mm:
1518         (-[MyFirstInterface getString]):
1519
1520 2004-02-15  Darin Adler  <darin@apple.com>
1521
1522         Reviewed by Dave.
1523
1524         * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
1525         and removing redundant settings of things that match defaults in other build styles.
1526
1527 2004-02-13  Richard Williamson   <rjw@apple.com>
1528
1529         Work towards the JavaScript ObjC bindings.  The bindings now work for 
1530         simple scalar types.  testbindings.mm is an illustration of how the 
1531         bindings work.
1532
1533         Reviewed by Ken.
1534
1535         * JavaScriptCore.pbproj/project.pbxproj:
1536         * Makefile.am:
1537         * bindings/jni/jni_class.cpp:
1538         (JavaClass::methodsNamed):
1539         * bindings/jni/jni_class.h:
1540         * bindings/jni/jni_instance.cpp:
1541         (JavaInstance::invokeMethod):
1542         * bindings/jni/jni_instance.h:
1543         * bindings/jni/jni_runtime.h:
1544         (KJS::Bindings::JavaMethod::returnType):
1545         * bindings/make_testbindings: Added.
1546         * bindings/objc/objc_class.h: Added.
1547         (KJS::Bindings::ObjcClass::~ObjcClass):
1548         (KJS::Bindings::ObjcClass::ObjcClass):
1549         (KJS::Bindings::ObjcClass::operator=):
1550         (KJS::Bindings::ObjcClass::constructorAt):
1551         (KJS::Bindings::ObjcClass::numConstructors):
1552         * bindings/objc/objc_class.mm: Added.
1553         (ObjcClass::_commonDelete):
1554         (ObjcClass::_commonCopy):
1555         (ObjcClass::_commonInit):
1556         (_createClassesByIsAIfNecessary):
1557         (ObjcClass::classForIsA):
1558         (ObjcClass::ObjcClass):
1559         (ObjcClass::name):
1560         (ObjcClass::methodsNamed):
1561         (ObjcClass::fieldNamed):
1562         * bindings/objc/objc_header.h: Added.
1563         * bindings/objc/objc_instance.h: Added.
1564         (KJS::Bindings::ObjcInstance::getObject):
1565         * bindings/objc/objc_instance.mm: Added.
1566         (ObjcInstance::ObjcInstance):
1567         (ObjcInstance::~ObjcInstance):
1568         (ObjcInstance::operator=):
1569         (ObjcInstance::begin):
1570         (ObjcInstance::end):
1571         (ObjcInstance::getClass):
1572         (ObjcInstance::invokeMethod):
1573         (ObjcInstance::defaultValue):
1574         (ObjcInstance::stringValue):
1575         (ObjcInstance::numberValue):
1576         (ObjcInstance::booleanValue):
1577         (ObjcInstance::valueOf):
1578         * bindings/objc/objc_jsobject.h: Added.
1579         * bindings/objc/objc_jsobject.mm: Added.
1580         * bindings/objc/objc_runtime.h:
1581         (KJS::Bindings::ObjcField::~ObjcField):
1582         (KJS::Bindings::ObjcField::ObjcField):
1583         (KJS::Bindings::ObjcField::operator=):
1584         (KJS::Bindings::ObjcMethod::ObjcMethod):
1585         (KJS::Bindings::ObjcMethod::~ObjcMethod):
1586         (KJS::Bindings::ObjcMethod::operator=):
1587         * bindings/objc/objc_runtime.mm: Added.
1588         (ObjcMethod::ObjcMethod):
1589         (ObjcMethod::name):
1590         (ObjcMethod::numParameters):
1591         (ObjcMethod::getMethodSignature):
1592         (ObjcField::ObjcField):
1593         (ObjcField::name):
1594         (ObjcField::type):
1595         (ObjcField::valueFromInstance):
1596         (ObjcField::setValueToInstance):
1597         * bindings/objc/objc_utility.h: Added.
1598         (KJS::Bindings::):
1599         * bindings/objc/objc_utility.mm: Added.
1600         (KJS::Bindings::JSMethodNameToObjCMethodName):
1601         (KJS::Bindings::convertValueToObjcValue):
1602         (KJS::Bindings::convertObjcValueToValue):
1603         (KJS::Bindings::objcValueTypeForType):
1604         * bindings/runtime.cpp:
1605         (MethodList::MethodList):
1606         (MethodList::operator=):
1607         (Instance::setValueOfField):
1608         (Instance::createBindingForLanguageInstance):
1609         (Instance::createRuntimeObject):
1610         * bindings/runtime.h:
1611         * bindings/runtime_method.cpp:
1612         (RuntimeMethodImp::RuntimeMethodImp):
1613         (RuntimeMethodImp::get):
1614         (RuntimeMethodImp::call):
1615         * bindings/runtime_method.h:
1616         * bindings/runtime_object.cpp:
1617         (RuntimeObjectImp::get):
1618         (RuntimeObjectImp::hasProperty):
1619         * bindings/test.js: Added.
1620         * bindings/testbindings.mm: Added.
1621         (-[MySecondInterface init]):
1622         (-[MyFirstInterface init]):
1623         (-[MyFirstInterface dealloc]):
1624         (+[MyFirstInterface JavaScriptNameForSelector:]):
1625         (-[MyFirstInterface getInt]):
1626         (-[MyFirstInterface setInt:]):
1627         (-[MyFirstInterface getMySecondInterface]):
1628         (-[MyFirstInterface logMessage:]):
1629         (GlobalImp::className):
1630         (readJavaScriptFromFile):
1631         (main):
1632
1633 === Safari-128 ===
1634
1635 2004-02-08  Darin Adler  <darin@apple.com>
1636
1637         Reviewed by Dave.
1638
1639         - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
1640
1641         * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
1642         macros from working right in C++ code that uses the <cctype> header.
1643
1644         * kjs/ustring.cpp:
1645         (KJS::inlineUTF8SequenceLengthNonASCII): Added.
1646         (KJS::UTF8SequenceLengthNonASCII): Added.
1647         (KJS::inlineUTF8SequenceLength): Added.
1648         (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
1649         (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
1650         (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
1651         (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
1652         (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
1653
1654         - fixed the test program so it won't hit the interpreter lock assertion
1655
1656         * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
1657
1658 === Safari-127 ===
1659
1660 2004-02-06  Richard Williamson   <rjw@apple.com>
1661
1662         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.
1663
1664         Reviewed by John.
1665
1666         * bindings/jni/jni_jsobject.cpp:
1667         (JSObject::toString):
1668         * bindings/jni/jni_utility.cpp:
1669         (KJS::Bindings::convertValueToJValue):
1670
1671 2004-02-02  Darin Adler  <darin@apple.com>
1672
1673         Reviewed by Maciej.
1674
1675         - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
1676
1677         * kjs/array_object.cpp:
1678         (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
1679         we start putting values in. This prevents new Array(2147483647) from causing trouble.
1680         (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
1681         number is out of range. This prevents new Array(-1) from causing trouble.
1682
1683         - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
1684
1685         * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
1686         casting to int. Results now match those in other browsers.
1687
1688 2004-02-02  Darin Adler  <darin@apple.com>
1689
1690         Reviewed by Maciej.
1691
1692         - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
1693         - fixed other related overflow issues
1694
1695         * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
1696         * kjs/value.cpp:
1697         (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
1698         must not restrict values to the range of a particular integer type.
1699         (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
1700         proper handling for negative results from fmod.
1701         (ValueImp::toUInt32): Ditto.
1702         (ValueImp::toUInt16): Ditto.
1703         (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
1704
1705         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
1706         out-of-integer-range values better in the slice function.
1707         * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
1708         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
1709         out-of-integer-range values better in the toString function.
1710         * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
1711         out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
1712         and substr functions.
1713
1714 === Safari-126 ===
1715
1716 2004-01-30  Richard Williamson   <rjw@apple.com>
1717
1718         Fixed 3542044.  Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
1719
1720         Reviewed by Darin.
1721
1722         * bindings/jni/jni_instance.cpp:
1723         (JavaInstance::stringValue):
1724
1725 2004-01-26  Darin Adler  <darin@apple.com>
1726
1727         * Makefile.am: Switch from pbxbuild to xcodebuild.
1728
1729 2004-01-22  Richard Williamson   <rjw@apple.com>
1730
1731         Added stubs for ObjC language binding to JavaScript.
1732
1733         * JavaScriptCore.pbproj/project.pbxproj:
1734         * bindings/jni/jni_runtime.h:
1735         * bindings/objc/objc_runtime.h: Added.
1736         (KJS::Bindings::ObjcParameter::ObjcParameter):
1737         (KJS::Bindings::ObjcParameter::~ObjcParameter):
1738         (KJS::Bindings::ObjcParameter::operator=):
1739         (KJS::Bindings::ObjcParameter::type):
1740         (KJS::Bindings::ObjcConstructor::ObjcConstructor):
1741         (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
1742         (KJS::Bindings::ObjcConstructor::_commonCopy):
1743         (KJS::Bindings::ObjcConstructor::operator=):
1744         (KJS::Bindings::ObjcConstructor::value):
1745         (KJS::Bindings::ObjcConstructor::parameterAt):
1746         (KJS::Bindings::ObjcConstructor::numParameters):
1747         (KJS::Bindings::ObjcField::ObjcField):
1748         (KJS::Bindings::ObjcField::~ObjcField):
1749         * bindings/runtime.h:
1750
1751 2004-01-22  Richard Williamson   <rjw@apple.com>
1752
1753         Simplified JavaString by using UString as backing store.  This
1754         revealed a bug in CString's assignment operator which I fixed.
1755
1756         Removed some dead code.
1757  
1758         Reviewed by John.
1759
1760         * bindings/jni/jni_runtime.h:
1761         (KJS::Bindings::JavaString::JavaString):
1762         (KJS::Bindings::JavaString::_commonInit):
1763         (KJS::Bindings::JavaString::UTF8String):
1764         (KJS::Bindings::JavaString::uchars):
1765         (KJS::Bindings::JavaString::length):
1766         (KJS::Bindings::JavaString::ustring):
1767         * bindings/runtime_object.cpp:
1768         (RuntimeObjectImp::RuntimeObjectImp):
1769         * bindings/runtime_object.h:
1770         * kjs/ustring.cpp:
1771         (KJS::CString::CString):
1772         (KJS::CString::operator=):
1773
1774 === Safari-125 ===
1775
1776 === Safari-124 ===
1777
1778 2004-01-16  Richard Williamson   <rjw@apple.com>
1779
1780         Fixed 3525853.  We weren't handling mapping to overloaded Java
1781         methods very well.  Even though this is undefined the other
1782         browsers support it.  Also fixed a bug with returning arrays
1783         from Java functions.
1784
1785         Reviewed by John.
1786
1787         * bindings/jni/jni_class.cpp:
1788         (JavaClass::_commonInit):
1789         (JavaClass::methodsNamed):
1790         * bindings/jni/jni_class.h:
1791         * bindings/jni/jni_instance.cpp:
1792         (JavaInstance::invokeMethod):
1793         * bindings/jni/jni_instance.h:
1794         * bindings/jni/jni_runtime.cpp:
1795         (JavaArray::convertJObjectToArray):
1796         (JavaField::valueFromInstance):
1797         (JavaMethod::signature):
1798         (JavaArray::valueAt):
1799         * bindings/jni/jni_runtime.h:
1800         * bindings/jni_jsobject.cpp:
1801         (JSObject::call):
1802         (JSObject::convertJObjectToValue):
1803         * bindings/runtime.cpp:
1804         (MethodList::addMethod):
1805         (MethodList::length):
1806         (MethodList::methodAt):
1807         (MethodList::~MethodList):
1808         * bindings/runtime.h:
1809         (KJS::Bindings::MethodList::MethodList):
1810         * bindings/runtime_method.cpp:
1811         (RuntimeMethodImp::RuntimeMethodImp):
1812         (RuntimeMethodImp::get):
1813         (RuntimeMethodImp::call):
1814         * bindings/runtime_method.h:
1815         * bindings/runtime_object.cpp:
1816         (RuntimeObjectImp::get):
1817         (RuntimeObjectImp::hasProperty):
1818
1819 2004-01-16  Richard Williamson   <rjw@apple.com>
1820
1821         Fixed 3531229.  Another place that needs the  Push/PopLocalFrame
1822         protection implemented for 3530401.
1823
1824         Reviewed by John.
1825
1826         * bindings/runtime_method.cpp:
1827         (RuntimeMethodImp::call):
1828
1829 2004-01-15  Richard Williamson   <rjw@apple.com>
1830
1831         Fixed 3530401.  JNI doesn't cleanup local refs created on the
1832         main thread.   IMO this is a bad bug in our JMI implementation.
1833
1834         To work-around the problem I explicitly delete all local refs.
1835         Further, I've added Push/PopLocalFrame calls to catch any refs
1836         that I may have missed.  This will guarantee that we don't leak
1837         any Java references.
1838
1839         Reviewed by John.
1840
1841         * bindings/jni/jni_class.cpp:
1842         (JavaClass::_commonInit):
1843         (JavaClass::JavaClass):
1844         * bindings/jni/jni_instance.cpp:
1845         (JavaInstance::begin):
1846         (JavaInstance::end):
1847         * bindings/jni/jni_instance.h:
1848         * bindings/jni/jni_runtime.cpp:
1849         (JavaConstructor::JavaConstructor):
1850         (JavaMethod::JavaMethod):
1851         * bindings/jni_jsobject.cpp:
1852         (JSObject::listFromJArray):
1853         * bindings/runtime.h:
1854         (KJS::Bindings::Instance::begin):
1855         (KJS::Bindings::Instance::end):
1856         * bindings/runtime_object.cpp:
1857         (RuntimeObjectImp::get):
1858         (RuntimeObjectImp::put):
1859         (RuntimeObjectImp::canPut):
1860         (RuntimeObjectImp::hasProperty):
1861         (RuntimeObjectImp::defaultValue):
1862
1863 2004-01-15  Vicki Murley  <vicki@apple.com>
1864
1865         Reviewed by Darin.
1866
1867         * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
1868
1869 2004-01-14  Richard Williamson   <rjw@apple.com>
1870         
1871         Fixed 3529466.  With recent changes to Java plugin we must no
1872         longer call DeleteLocalRef().  Not a problem, it was an optimization anyway.
1873
1874         Reviewed by John.
1875
1876         * bindings/jni/jni_instance.cpp:
1877         (JObjectWrapper::JObjectWrapper):
1878
1879 === Safari-122 ===
1880
1881 2004-01-14  Richard Williamson   <rjw@apple.com>
1882
1883         Fixed 3529010.
1884
1885         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.
1886
1887         Reviewed by John.
1888
1889         * bindings/jni_jsobject.cpp:
1890         (addJavaReference):
1891         (removeJavaReference):
1892         (RootObject::removeAllJavaReferencesForRoot):
1893         (JSObject::invoke):
1894
1895 2004-01-13  Richard Williamson   <rjw@apple.com>
1896
1897         Fixed 3528324. 
1898
1899         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.
1900
1901         Reviewed by Hyatt.
1902
1903         * bindings/jni_jsobject.h:
1904         (KJS::Bindings::RootObject::~RootObject):
1905
1906 === Safari-121 ===
1907
1908 === Safari-120 ===
1909
1910 2004-01-06  Richard Williamson   <rjw@apple.com>
1911
1912         Fixed 3521814.  Finalize messages weren't being dispatched!
1913
1914         Reviewed by John.
1915
1916         * bindings/jni_jsobject.cpp:
1917         (JSObject::invoke):
1918
1919 2004-01-05  Richard Williamson   <rjw@apple.com>
1920
1921         Added cache of JNI method IDs to minimize allocations.  This mitigates the problem
1922         described by 3515579.
1923
1924         Also cleanup up logging of Java exceptions.
1925
1926         Reviewed by John.
1927
1928         * bindings/jni/jni_class.cpp:
1929         (JavaClass::classForInstance):
1930         * bindings/jni/jni_instance.cpp:
1931         (JavaInstance::JavaInstance):
1932         (JavaInstance::getClass):
1933         (JavaInstance::invokeMethod):
1934         (JObjectWrapper::JObjectWrapper):
1935         (JObjectWrapper::~JObjectWrapper):
1936         * bindings/jni/jni_instance.h:
1937         (KJS::Bindings::JavaInstance::operator=):
1938         * bindings/jni/jni_runtime.cpp:
1939         (JavaMethod::JavaMethod):
1940         (JavaMethod::methodID):
1941         * bindings/jni/jni_runtime.h:
1942         (KJS::Bindings::JavaMethod::JavaMethod):
1943         * bindings/jni/jni_utility.cpp:
1944         (callJNIMethod):
1945         (callJNIMethodIDA):
1946         (callJNIMethodA):
1947         (KJS::Bindings::getMethodID):
1948         (KJS::Bindings::callJNIVoidMethodIDA):
1949         (KJS::Bindings::callJNIObjectMethodIDA):
1950         (KJS::Bindings::callJNIByteMethodIDA):
1951         (KJS::Bindings::callJNICharMethodIDA):
1952         (KJS::Bindings::callJNIShortMethodIDA):
1953         (KJS::Bindings::callJNIIntMethodIDA):
1954         (KJS::Bindings::callJNILongMethodIDA):
1955         (KJS::Bindings::callJNIFloatMethodIDA):
1956         (KJS::Bindings::callJNIDoubleMethodIDA):
1957         (KJS::Bindings::callJNIBooleanMethodIDA):
1958         (KJS::Bindings::getCharactersFromJStringInEnv):
1959         (KJS::Bindings::getUCharactersFromJStringInEnv):
1960         (KJS::Bindings::getJNIField):
1961         * bindings/jni/jni_utility.h:
1962
1963 l2003-12-23  John Sullivan  <sullivan@apple.com>
1964
1965         * JavaScriptCore.pbproj/project.pbxproj:
1966         Xcode version wars, harmless
1967
1968 2003-12-23  Darin Adler  <darin@apple.com>
1969
1970         Reviewed by John (concept, not code, which is just the old code coming back).
1971
1972         - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
1973
1974         * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
1975         mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
1976
1977 2003-12-19  Richard Williamson   <rjw@apple.com>
1978
1979         Fixed 3515597.  When an error occurs we need
1980         to make sure result values are zeroed.
1981
1982         Cleaned up logs by adding a newline.
1983
1984         Reviewed by John.
1985
1986         * bindings/jni/jni_utility.cpp:
1987         (KJS::Bindings::getJavaVM):
1988         (KJS::Bindings::getJNIEnv):
1989         (callJNIMethod):
1990         (callJNIMethodA):
1991         (KJS::Bindings::getJNIField):
1992         * bindings/jni_jsobject.cpp:
1993         (JSObject::convertValueToJObject):
1994
1995 === Safari-119 ===
1996
1997 2003-12-17  Richard Williamson   <rjw@apple.com>
1998
1999         Ensure that all the symbols we export are in the KJS
2000         namespace (3512245).
2001
2002         Also renamed JavaString.characters() to JavaString.UTF8String()
2003         for enhanced clarity.
2004
2005         Added some sanity checking to constructor of JObjectWrapper.
2006
2007         Reviewed by Dave.
2008
2009         * ChangeLog:
2010         * bindings/jni/jni_class.cpp:
2011         * bindings/jni/jni_class.h:
2012         * bindings/jni/jni_instance.cpp:
2013         (JavaInstance::invokeMethod):
2014         (JObjectWrapper::JObjectWrapper):
2015         * bindings/jni/jni_instance.h:
2016         * bindings/jni/jni_runtime.cpp:
2017         (JavaParameter::JavaParameter):
2018         (JavaField::JavaField):
2019         (JavaMethod::JavaMethod):
2020         (JavaMethod::signature):
2021         * bindings/jni/jni_runtime.h:
2022         (KJS::Bindings::JavaString::ascii):
2023         (KJS::Bindings::JavaString::UTF8String):
2024         (KJS::Bindings::JavaString::JavaString):
2025         (KJS::Bindings::JavaString::_commonInit):
2026         (KJS::Bindings::JavaString::uchars):
2027         (KJS::Bindings::JavaString::length):
2028         (KJS::Bindings::JavaString::ustring):
2029         (KJS::Bindings::JavaParameter::type):
2030         (KJS::Bindings::JavaField::name):
2031         (KJS::Bindings::JavaField::type):
2032         (KJS::Bindings::JavaMethod::name):
2033         (KJS::Bindings::JavaMethod::returnType):
2034         * bindings/jni/jni_utility.cpp:
2035         (KJS::Bindings::getJavaVM):
2036         (KJS::Bindings::getJNIEnv):
2037         (KJS::Bindings::callJNIVoidMethod):
2038         (KJS::Bindings::callJNIObjectMethod):
2039         (KJS::Bindings::callJNIBooleanMethod):
2040         (KJS::Bindings::callJNIByteMethod):
2041         (KJS::Bindings::callJNICharMethod):
2042         (KJS::Bindings::callJNIShortMethod):
2043         (KJS::Bindings::callJNIIntMethod):
2044         (KJS::Bindings::callJNILongMethod):
2045         (KJS::Bindings::callJNIFloatMethod):
2046         (KJS::Bindings::callJNIDoubleMethod):
2047         (KJS::Bindings::callJNIVoidMethodA):
2048         (KJS::Bindings::callJNIObjectMethodA):
2049         (KJS::Bindings::callJNIByteMethodA):
2050         (KJS::Bindings::callJNICharMethodA):
2051         (KJS::Bindings::callJNIShortMethodA):
2052         (KJS::Bindings::callJNIIntMethodA):
2053         (KJS::Bindings::callJNILongMethodA):
2054         (KJS::Bindings::callJNIFloatMethodA):
2055         (KJS::Bindings::callJNIDoubleMethodA):
2056         (KJS::Bindings::callJNIBooleanMethodA):
2057         (KJS::Bindings::getCharactersFromJString):
2058         (KJS::Bindings::releaseCharactersForJString):
2059         (KJS::Bindings::getCharactersFromJStringInEnv):
2060         (KJS::Bindings::releaseCharactersForJStringInEnv):
2061         (KJS::Bindings::getUCharactersFromJStringInEnv):
2062         (KJS::Bindings::releaseUCharactersForJStringInEnv):
2063         (KJS::Bindings::JNITypeFromClassName):
2064         (KJS::Bindings::signatureFromPrimitiveType):
2065         (KJS::Bindings::JNITypeFromPrimitiveType):
2066         (KJS::Bindings::getJNIField):
2067         (KJS::Bindings::convertValueToJValue):
2068         * bindings/jni/jni_utility.h:
2069         * bindings/jni_jsobject.cpp:
2070         (KJS::Bindings::JSObject::invoke):
2071         (KJS::Bindings::JSObject::JSObject):
2072         (KJS::Bindings::JSObject::call):
2073         (KJS::Bindings::JSObject::eval):
2074         (KJS::Bindings::JSObject::getMember):
2075         (KJS::Bindings::JSObject::setMember):
2076         (KJS::Bindings::JSObject::removeMember):
2077         (KJS::Bindings::JSObject::getSlot):
2078         (KJS::Bindings::JSObject::setSlot):
2079         (KJS::Bindings::JSObject::toString):
2080         (KJS::Bindings::JSObject::finalize):
2081         (KJS::Bindings::JSObject::createNative):
2082         (KJS::Bindings::JSObject::convertValueToJObject):
2083         (KJS::Bindings::JSObject::convertJObjectToValue):
2084         (KJS::Bindings::JSObject::listFromJArray):
2085         * bindings/jni_jsobject.h:
2086         * bindings/runtime.cpp:
2087         * bindings/runtime.h:
2088         * bindings/runtime_method.cpp:
2089         * bindings/runtime_method.h:
2090
2091 === Safari-118 ===
2092
2093 2003-12-16  Richard Williamson   <rjw@apple.com>
2094
2095         Ack!  More assertions.  Lock ALL entry points into the interpreter!
2096         (3511733).
2097
2098         Reviewed by Ken.
2099
2100         * bindings/jni_jsobject.cpp:
2101         (Bindings::JSObject::call):
2102         (Bindings::JSObject::eval):
2103         (Bindings::JSObject::getMember):
2104         (Bindings::JSObject::setMember):
2105         (Bindings::JSObject::removeMember):
2106         (Bindings::JSObject::getSlot):
2107         (Bindings::JSObject::setSlot):
2108         (Bindings::JSObject::convertJObjectToValue):
2109
2110 2003-12-15  Richard Williamson   <rjw@apple.com>
2111
2112         Fixed a couple of snafus and removed some logging.
2113
2114         Reviewed by Maciej.
2115
2116         * bindings/jni_jsobject.cpp:
2117         (Bindings::performJavaScriptAccess):
2118         (Bindings::completedJavaScriptAccess):
2119         (Bindings::dispatchToJavaScriptThread):
2120         Removed some annoying JS_LOG clutter.
2121
2122         (Bindings::RootObject::removeAllJavaReferencesForRoot):
2123         Fixed allocation of key buffer that was called after it was needed.
2124
2125         (Bindings::JSObject::invoke):
2126         (Bindings::JSObject::JSObject):
2127         (Bindings::JSObject::getMember):
2128         (Bindings::JSObject::getSlot):
2129         Added additional interpreter locks around getMember and getSlot. 
2130         These functions may cause allocation of JS impls.  
2131
2132 2003-12-15  Richard Williamson   <rjw@apple.com>
2133
2134         args weren't passed to 'call' invocation.  d'oh.
2135         lock interpreter when we create instances of JS impls.        
2136
2137         Reviewed by Maciej.
2138
2139         * bindings/jni_jsobject.cpp:
2140         (Bindings::JSObject::call):
2141         (Bindings::JSObject::eval):
2142         (Bindings::JSObject::getMember):
2143         (Bindings::JSObject::setMember):
2144         (Bindings::JSObject::getSlot):
2145         (Bindings::JSObject::convertValueToJObject):
2146         (Bindings::JSObject::convertJObjectToValue):
2147         (Bindings::JSObject::listFromJArray):
2148         * bindings/jni_jsobject.h:
2149
2150 2003-12-15  Richard Williamson   <rjw@apple.com>
2151
2152         Last piece of LiveConnect!  This checkin adds implementation
2153         of the Java to JavaScript object conversion functions.
2154
2155         Reviewed by John.
2156
2157         * bindings/jni/jni_instance.cpp:
2158         (JavaInstance::invokeMethod):
2159         * bindings/jni/jni_utility.cpp:
2160         * bindings/jni/jni_utility.h:
2161         * bindings/jni_jsobject.cpp:
2162         (Bindings::JSObject::invoke):
2163         (Bindings::JSObject::call):
2164         (Bindings::JSObject::eval):
2165         (Bindings::JSObject::getMember):
2166         (Bindings::JSObject::setMember):
2167         (Bindings::JSObject::getSlot):
2168         (Bindings::JSObject::setSlot):
2169         (Bindings::JSObject::createNative):
2170         (Bindings::JSObject::convertValueToJObject):
2171         (Bindings::JSObject::convertJObjectToValue):
2172         (Bindings::JSObject::listFromJArray):
2173         * bindings/jni_jsobject.h:
2174         (Bindings::):
2175         * bindings/runtime_method.cpp:
2176         (RuntimeMethodImp::get):
2177         (RuntimeMethodImp::codeType):
2178         (RuntimeMethodImp::execute):
2179
2180 2003-12-12  Richard Williamson   <rjw@apple.com>
2181
2182         Added implementation of stubs in JSObject.  All that
2183         remains is a couple of simple conversion functions stubs and
2184         we're done with LiveConnect.  Also, changed string passing to
2185         JS to use uchars instead of chars.  
2186
2187         Reviewed by Maciej.
2188
2189         * bindings/jni/jni_runtime.h:
2190         (Bindings::JavaString::JavaString):
2191         (Bindings::JavaString::_commonInit):
2192         (Bindings::JavaString::_commonCopy):
2193         (Bindings::JavaString::_commonDelete):
2194         (Bindings::JavaString::~JavaString):
2195         (Bindings::JavaString::operator=):
2196         (Bindings::JavaString::uchars):
2197         (Bindings::JavaString::length):
2198         (Bindings::JavaString::ustring):
2199         * bindings/jni/jni_utility.cpp:
2200         (getUCharactersFromJStringInEnv):
2201         (releaseUCharactersForJStringInEnv):
2202         (convertValueToJObject):
2203         (convertJObjectToValue):
2204         * bindings/jni/jni_utility.h:
2205         * bindings/jni_jsobject.cpp:
2206         (Bindings::JSObject::invoke):
2207         (Bindings::JSObject::call):
2208         (Bindings::JSObject::eval):
2209         (Bindings::JSObject::getMember):
2210         (Bindings::JSObject::setMember):
2211         (Bindings::JSObject::removeMember):
2212         (Bindings::JSObject::getSlot):
2213         (Bindings::JSObject::setSlot):
2214         * bindings/jni_jsobject.h:
2215
2216 2003-12-12  Richard Williamson   <rjw@apple.com>
2217
2218         Ensure that all calls from Java into JavaScript are
2219         performed on a designated thread (the main thread).
2220
2221         Reviewed by Ken.
2222
2223         * bindings/jni_jsobject.cpp:
2224         (isJavaScriptThread):
2225         (rootForImp):
2226         (Bindings::performJavaScriptAccess):
2227         (Bindings::completedJavaScriptAccess):
2228         (Bindings::initializeJavaScriptAccessLock):
2229         (Bindings::lockJavaScriptAccess):
2230         (Bindings::unlockJavaScriptAccess):
2231         (Bindings::dispatchToJavaScriptThread):
2232         (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
2233         (Bindings::RootObject::removeAllJavaReferencesForRoot):
2234         (Bindings::JSObject::invoke):
2235         (Bindings::JSObject::JSObject):
2236         (Bindings::JSObject::call):
2237         (Bindings::JSObject::eval):
2238         (Bindings::JSObject::getMember):
2239         (Bindings::JSObject::setMember):
2240         (Bindings::JSObject::removeMember):
2241         (Bindings::JSObject::getSlot):
2242         (Bindings::JSObject::setSlot):
2243         (Bindings::JSObject::toString):
2244         (Bindings::JSObject::finalize):
2245         (Bindings::JSObject::getWindow):
2246         * bindings/jni_jsobject.h:
2247         (Bindings::RootObject::~RootObject):
2248         (Bindings::RootObject::findRootObjectForNativeHandleFunction):
2249         (Bindings::RootObject::runLoop):
2250         (Bindings::RootObject::performJavaScriptSource):
2251         (Bindings::):
2252
2253 2003-12-11  Richard Williamson   <rjw@apple.com>
2254
2255         Added support for calling a JavaScript function from
2256         Java.  Right now this only works for void func(void)
2257         functions, but the conversion of args and return values
2258         will come shortly.
2259
2260         Cleaned up and verified reference counting scheme, and
2261         dereferencing of vended JavaScript objects when applet is
2262         destroyed (actually when part is destroyed).
2263         
2264         Removed link hack for testkjs now that the Java folks think
2265         they have a solution for the 1.4.2 JavaVM link problem.  Although
2266         Greg B. thinks his solution may cause problems for the 1.3.1
2267         version of the VM!?!
2268
2269         Reviewed by Ken.
2270
2271         * Makefile.am:
2272         * bindings/jni/jni_runtime.h:
2273         (Bindings::JavaString::JavaString):
2274         * bindings/jni/jni_utility.cpp:
2275         (convertValueToJValue):
2276         (convertValueToJObject):
2277         (listFromJArray):
2278         * bindings/jni/jni_utility.h:
2279         * bindings/jni_jsobject.cpp:
2280         (KJS_setFindRootObjectForNativeHandleFunction):
2281         (KJS_findRootObjectForNativeHandleFunction):
2282         (getReferencesByRootDictionary):
2283         (getReferencesDictionary):
2284         (findReferenceDictionary):
2285         (rootForImp):
2286         (addJavaReference):
2287         (removeJavaReference):
2288         * bindings/jni_jsobject.h:
2289         (Bindings::RootObject::RootObject):
2290         (Bindings::RootObject::~RootObject):
2291         (Bindings::RootObject::setRootObjectImp):
2292         (Bindings::RootObject::rootObjectImp):
2293         (Bindings::RootObject::setInterpreter):
2294         (Bindings::RootObject::interpreter):
2295
2296 === Safari-117 ===
2297
2298 2003-12-10  Darin Adler  <darin@apple.com>
2299
2300         Reviewed by Maciej.
2301
2302         - fixed regression in JavaScript tests reported by the KDE guys
2303         - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
2304
2305         * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
2306         * kjs/ustring.cpp:
2307         (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
2308         tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
2309         and binary compatibility than default parameter values.
2310         (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
2311
2312         * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
2313         "tolerate empty string" parameter.
2314
2315 2003-12-10  Richard Williamson   <rjw@apple.com>
2316
2317         Added code to manage reference counting of JavaScript
2318         objects passed to Java.   Also added implementation of
2319         KJS_JSCreateNativeJSObject.  This is the function that
2320         provides the root object to Java (KJS::Window).
2321
2322         Reviewed by Hyatt.
2323
2324         * JavaScriptCore.pbproj/project.pbxproj:
2325         * bindings/jni_jsobject.cpp:
2326         (KJS_setFindObjectForNativeHandleFunction):
2327         (KJS_findObjectForNativeHandleFunction):
2328         (getReferencesByOwnerDictionary):
2329         (getReferencesDictionary):
2330         (findReferenceDictionary):
2331         (addJavaReference):
2332         (removeJavaReference):
2333         (removeAllJavaReferencesForOwner):
2334         * bindings/jni_jsobject.h:
2335
2336 2003-12-09  Richard Williamson   <rjw@apple.com>
2337
2338         LiveConnect stubs that correspond to the native methods
2339         on JSObject.  These will be called from the new Java plugin
2340         when an instance of JSObject is instantiated and messaged.
2341         When these are implemented the Java will be able to originate
2342         calls into JavaScript.
2343
2344         Also a temporary work-around added to Makefile.am to solve
2345         a link problem.  The 1.4.2 JavaVM accidentally links against
2346         libobjc.  This call a failure linking testkjs.  Mike Hay is
2347         working with someone to fix the problem (3505587).
2348
2349         Reviewed by Chris.
2350
2351         * JavaScriptCore.pbproj/project.pbxproj:
2352         * Makefile.am:
2353         * bindings/jni_jsobject.cpp: Added.
2354         (KJS_JSCreateNativeJSObject):
2355         (KJS_JSObject_JSFinalize):
2356         (KJS_JSObject_JSObjectCall):
2357         (KJS_JSObject_JSObjectEval):
2358         (KJS_JSObject_JSObjectGetMember):
2359         (KJS_JSObject_JSObjectSetMember):
2360         (KJS_JSObject_JSObjectRemoveMember):
2361         (KJS_JSObject_JSObjectGetSlot):
2362         (KJS_JSObject_JSObjectSetSlot):
2363         (KJS_JSObject_JSObjectToString):
2364         * bindings/jni_jsobject.h: Added.
2365
2366 2003-12-09  Maciej Stachowiak  <mjs@apple.com>
2367
2368         Reviewed by John.
2369
2370         <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
2371
2372         * kjs/collector.cpp:
2373         (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
2374         (KJS::Collector::collect): likewise
2375
2376 2003-12-08  Richard Williamson   <rjw@apple.com>
2377
2378         LiveConnect:  The last piece of the JavaScript side of the
2379         LiveConnect implementation.  This change adds support for
2380         setting/getting values from Java arrays in JavaScript.
2381
2382         Reviewed by John.
2383
2384         * bindings/jni/jni_instance.h:
2385         * bindings/jni/jni_runtime.cpp:
2386         (JavaField::JavaField):
2387         (convertJObjectToArray):
2388         (JavaArray::JavaArray):
2389         (JavaArray::~JavaArray):
2390         (JavaArray::setValueAt):
2391         (JavaArray::valueAt):
2392         (JavaArray::getLength):
2393         * bindings/jni/jni_runtime.h:
2394         (Bindings::JavaArray::operator=):
2395         (Bindings::JavaArray::javaArray):
2396         * bindings/jni/jni_utility.cpp:
2397         (JNITypeFromPrimitiveType):
2398         (convertValueToJValue):
2399         * bindings/jni/jni_utility.h:
2400         * bindings/runtime.h:
2401         * bindings/runtime_array.cpp:
2402         (RuntimeArrayImp::RuntimeArrayImp):
2403         (RuntimeArrayImp::~RuntimeArrayImp):
2404         (RuntimeArrayImp::get):
2405         (RuntimeArrayImp::put):
2406         (RuntimeArrayImp::hasProperty):
2407         * bindings/runtime_array.h:
2408         (KJS::RuntimeArrayImp::getLength):
2409         (KJS::RuntimeArrayImp::getConcreteArray):
2410         * bindings/runtime_object.cpp:
2411         (RuntimeObjectImp::get):
2412         (RuntimeObjectImp::canPut):
2413         (RuntimeObjectImp::hasProperty):
2414
2415 2003-12-05  Richard Williamson   <rjw@apple.com>
2416
2417         LiveConnect:  Part 1 of supporting JS bindings to
2418         native language arrays.
2419
2420         Reviewed by Chris.
2421
2422         * JavaScriptCore.pbproj/project.pbxproj:
2423         * bindings/jni/jni_runtime.cpp:
2424         (JavaField::JavaField):
2425         (convertJObjectToArray):
2426         (JavaField::valueFromInstance):
2427         (JavaField::setValueToInstance):
2428         * bindings/jni/jni_runtime.h:
2429         * bindings/runtime.cpp:
2430         (Instance::setValueOfField):
2431         * bindings/runtime.h:
2432         (Bindings::Array::~Array):
2433
2434 2003-12-04  Richard Williamson   <rjw@apple.com>
2435
2436         LiveConnect:  Moved defaultValue into concrete implementation because
2437         more intelligent conversion can be perform with knowledge
2438         of the class of the original instance.
2439
2440         Reviewed by Chris.
2441
2442         * bindings/jni/jni_class.cpp:
2443         (JavaClass::isNumberClass):
2444         (JavaClass::isBooleanClass):
2445         (JavaClass::isStringClass):
2446         * bindings/jni/jni_class.h:
2447         * bindings/jni/jni_instance.cpp:
2448         (JavaInstance::defaultValue):
2449         (JavaInstance::valueOf):
2450         * bindings/jni/jni_instance.h:
2451         (Bindings::JavaInstance::javaInstance):
2452         * bindings/runtime.h:
2453         * bindings/runtime_object.cpp:
2454         (RuntimeObjectImp::defaultValue):
2455
2456 2003-12-04  Richard Williamson   <rjw@apple.com>
2457
2458         LiveConnect:  Added support for setting the value of Java
2459         fields.
2460
2461         Reviewed by Chris.
2462
2463         * bindings/jni/jni_instance.cpp:
2464         (JavaInstance::invokeMethod):
2465         * bindings/jni/jni_runtime.cpp:
2466         (JavaParameter::JavaParameter):
2467         (JavaField::JavaField):
2468         (JavaField::valueFromInstance):
2469         (JavaField::setValueToInstance):
2470         (JavaMethod::JavaMethod):
2471         * bindings/jni/jni_runtime.h:
2472         (Bindings::JavaField::getJNIType):
2473         * bindings/jni/jni_utility.cpp:
2474         (JNITypeFromClassName):
2475         (convertValueToJValue):
2476         * bindings/jni/jni_utility.h:
2477         * bindings/runtime.cpp:
2478         (Instance::setValueOfField):
2479         * bindings/runtime.h:
2480         * bindings/runtime_object.cpp:
2481         (RuntimeObjectImp::get):
2482         (RuntimeObjectImp::put):
2483         (RuntimeObjectImp::defaultValue):
2484
2485 2003-12-04  Richard Williamson   <rjw@apple.com>
2486
2487         Added support for string conversions.
2488         Changed various JavaString member variables to be inline.
2489         Implemented defaultValue for context relevant type coercion.
2490
2491         Reviewed by Chris.
2492
2493         * bindings/jni/jni_class.cpp:
2494         (JavaClass::JavaClass):
2495         (JavaClass::setClassName):
2496         (JavaClass::classForInstance):
2497         * bindings/jni/jni_class.h:
2498         * bindings/jni/jni_instance.cpp:
2499         (JavaInstance::stringValue):
2500         (JavaInstance::numberValue):
2501         (JavaInstance::booleanValue):
2502         (JavaInstance::invokeMethod):
2503         * bindings/jni/jni_instance.h:
2504         * bindings/jni/jni_runtime.cpp:
2505         (JavaParameter::JavaParameter):
2506         (JavaField::JavaField):
2507         (JavaMethod::JavaMethod):
2508         (appendClassName):
2509         (JavaMethod::signature):
2510         * bindings/jni/jni_runtime.h:
2511         (Bindings::JavaString::JavaString):
2512         (Bindings::JavaString::~JavaString):
2513         (Bindings::JavaString::operator=):
2514         (Bindings::JavaString::characters):
2515         (Bindings::JavaParameter::JavaParameter):
2516         (Bindings::JavaParameter::~JavaParameter):
2517         (Bindings::JavaParameter::operator=):
2518         (Bindings::JavaParameter::type):
2519         (Bindings::JavaField::JavaField):
2520         (Bindings::JavaField::~JavaField):
2521         (Bindings::JavaField::operator=):
2522         (Bindings::JavaField::name):
2523         (Bindings::JavaField::type):
2524         (Bindings::JavaMethod::JavaMethod):
2525         (Bindings::JavaMethod::_commonDelete):
2526         (Bindings::JavaMethod::name):
2527         (Bindings::JavaMethod::returnType):
2528         * bindings/jni/jni_utility.cpp:
2529         (convertValueToJValue):
2530         * bindings/runtime.h:
2531         (Bindings::Instance::valueOf):
2532         * bindings/runtime_method.cpp:
2533         (RuntimeMethodImp::call):
2534         * bindings/runtime_object.cpp:
2535         (RuntimeObjectImp::RuntimeObjectImp):
2536         (RuntimeObjectImp::get):
2537         (RuntimeObjectImp::defaultValue):
2538         * bindings/runtime_object.h:
2539         (KJS::RuntimeObjectImp::classInfo):
2540
2541 === Safari-116 ===
2542
2543 2003-12-03  Richard Williamson   <rjw@apple.com>
2544
2545         LiveConnect:  Added support for parameter passing to Java and conversion
2546         of return values.
2547
2548         Reviewed by Chris.
2549
2550         * bindings/jni/jni_instance.cpp:
2551         (JavaInstance::invokeMethod):
2552         * bindings/jni/jni_instance.h:
2553         * bindings/jni/jni_runtime.cpp:
2554         (JavaParameter::JavaParameter):
2555         (JavaMethod::JavaMethod):
2556         (JavaMethod::signature):
2557         * bindings/jni/jni_runtime.h:
2558         (Bindings::JavaParameter::JavaParameter):
2559         (Bindings::JavaParameter::operator=):
2560         (Bindings::JavaParameter::getJNIType):
2561         * bindings/jni/jni_utility.cpp:
2562         (callJNIBooleanMethodA):
2563         (convertValueToJValue):
2564         * bindings/jni/jni_utility.h:
2565         * bindings/runtime.h:
2566         * bindings/runtime_method.cpp:
2567         (RuntimeMethodImp::call):
2568         * bindings/runtime_object.cpp:
2569         (RuntimeObjectImp::get):
2570
2571 2003-12-02  Richard Williamson   <rjw@apple.com>
2572
2573         Added support for calling simple methods in Java from JavaScript.
2574         (void return and no parameters).  Yay, LiveConnect lives.
2575
2576         Still need write argument and return value conversion code.
2577
2578         Reviewed by Chris.
2579
2580         * JavaScriptCore.pbproj/project.pbxproj:
2581         * bindings/jni/jni_instance.cpp:
2582         (JavaInstance::getClass):
2583         (JavaInstance::invokeMethod):
2584         * bindings/jni/jni_instance.h:
2585         * bindings/jni/jni_runtime.cpp:
2586         (JavaMethod::JavaMethod):
2587         (JavaMethod::signature):
2588         (JavaMethod::JNIReturnType):
2589         * bindings/jni/jni_runtime.h:
2590         (Bindings::JavaMethod::_commonDelete):
2591         (Bindings::JavaMethod::_commonCopy):
2592         (Bindings::JavaMethod::name):
2593         * bindings/jni/jni_utility.cpp:
2594         (signatureFromPrimitiveType):
2595         * bindings/jni/jni_utility.h:
2596         * bindings/runtime.h:
2597         * bindings/runtime_method.cpp: Added.
2598         (RuntimeMethodImp::RuntimeMethodImp):
2599         (RuntimeMethodImp::~RuntimeMethodImp):
2600         (RuntimeMethodImp::get):
2601         (RuntimeMethodImp::implementsCall):
2602         (RuntimeMethodImp::call):
2603         (RuntimeMethodImp::codeType):
2604         (RuntimeMethodImp::execute):
2605         * bindings/runtime_method.h: Added.
2606         * bindings/runtime_object.cpp:
2607         (RuntimeObjectImp::RuntimeObjectImp):
2608         (RuntimeObjectImp::get):
2609         * bindings/runtime_object.h:
2610         * kjs/function.cpp:
2611         (FunctionImp::FunctionImp):
2612         * kjs/interpreter.h:
2613
2614 2003-12-01  Darin Adler  <darin@apple.com>
2615
2616         Reviewed by Maciej.
2617
2618         - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
2619
2620         * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
2621         This indirectly caused the string.replace bug.
2622
2623 2003-12-02  Maciej Stachowiak  <mjs@apple.com>
2624
2625         Merged patches from Harri Porten and David Faure to fix:
2626
2627         <rdar://problem/3497643>: reproducible crash printing self-referential array
2628         
2629         * kjs/array_object.cpp:
2630         (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
2631         * kjs/nodes.cpp:
2632         (FunctionCallNode::evaluate): Move function call depth check from here...
2633         * kjs/object.cpp:
2634         (KJS::Object::call): ...to here.
2635         * kjs/object.h: Un-inline Object::call now that it does more.
2636
2637 2003-12-01  Richard Williamson   <rjw@apple.com>
2638
2639         Fixed mistake in method signatures used to get boolean and integer fields.
2640
2641         Reviewed by Chris.
2642
2643         * bindings/jni/jni_runtime.cpp:
2644         (JavaField::valueFromInstance):
2645
2646 2003-12-01  Richard Williamson   <rjw@apple.com>
2647
2648 Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.
2649
2650 Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.
2651
2652 Added support for getting at Java object fields.
2653
2654         Reviewed by Chris.
2655
2656         * JavaScriptCore.pbproj/project.pbxproj:
2657         * Makefile.am:
2658         * bindings/jni/jni_instance.cpp:
2659         (JObjectWrapper::JObjectWrapper):
2660         * bindings/jni/jni_instance.h:
2661         (Bindings::JObjectWrapper::~JObjectWrapper):
2662         * bindings/jni/jni_runtime.cpp:
2663         (JavaField::valueFromInstance):
2664         * bindings/runtime_object.cpp:
2665         (RuntimeObjectImp::~RuntimeObjectImp):
2666         (RuntimeObjectImp::RuntimeObjectImp):
2667         (RuntimeObjectImp::get):
2668         (RuntimeObjectImp::deleteProperty):
2669         * bindings/runtime_object.h:
2670
2671 === Safari-115 ===
2672
2673 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
2674
2675         Patch from Harri Porten, reviewed by me.
2676
2677         - fixed 3491712 - String slice with negative arguments does not offset from end of string
2678         
2679         * kjs/string_object.cpp:
2680         (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
2681         adding length and clamping to [0,length-1].
2682
2683 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
2684
2685         Patch from Harri Porten, reviewed by me.
2686
2687         - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
2688         
2689         * kjs/function_object.cpp:
2690         (FunctionProtoFuncImp::call): Nest parentheses properly.
2691
2692 2003-11-20  Richard Williamson   <rjw@apple.com>
2693
2694         More LiveConnect stuff.  Primitive Java fields are now
2695         accessible from JavaScript!  Yay!
2696
2697         Reviewed by Maciej.
2698
2699         * bindings/jni/jni_class.cpp:
2700         (JavaClass::methodNamed):
2701         (JavaClass::fieldNamed):
2702         * bindings/jni/jni_class.h:
2703         (Bindings::JavaClass::_commonDelete):
2704         * bindings/jni/jni_instance.cpp:
2705         (JavaInstance::JavaInstance):
2706         (JavaInstance::~JavaInstance):
2707         (JavaInstance::getClass):
2708         * bindings/jni/jni_instance.h:
2709         (Bindings::JavaInstance::javaInstance):
2710         * bindings/jni/jni_runtime.cpp:
2711         (JavaField::JavaField):
2712         (JavaField::valueFromInstance):
2713         * bindings/jni/jni_runtime.h:
2714         (Bindings::JavaField::JavaField):
2715         (Bindings::JavaField::~JavaField):
2716         (Bindings::JavaField::operator=):
2717         * bindings/jni/jni_utility.cpp:
2718         (callJNIMethod):
2719         (callJNIMethodA):
2720         (callJNIVoidMethod):
2721         (callJNIObjectMethod):
2722         (callJNIBooleanMethod):
2723         (callJNIByteMethod):
2724         (callJNICharMethod):
2725         (callJNIShortMethod):
2726         (callJNIIntMethod):
2727         (callJNILongMethod):
2728         (callJNIFloatMethod):
2729         (callJNIDoubleMethod):
2730         (callJNIVoidMethodA):
2731         (callJNIObjectMethodA):
2732         (callJNIByteMethodA):
2733         (callJNICharMethodA):
2734         (callJNIShortMethodA):
2735         (callJNIIntMethodA):
2736         (callJNILongMethodA):
2737         (callJNIFloatMethodA):
2738         (callJNIDoubleMethodA):
2739         (releaseCharactersForJStringInEnv):
2740         (primitiveTypeFromClassName):
2741         (getJNIField):
2742         * bindings/jni/jni_utility.h:
2743         * bindings/runtime.cpp:
2744         (Instance::createBindingForLanguageInstance):
2745         (Instance::getValueOfField):
2746         * bindings/runtime.h:
2747         * bindings/runtime_object.cpp:
2748         (RuntimeObjectImp::get):
2749
2750 2003-11-20  Richard Williamson   <rjw@apple.com>
2751
2752         More LiveConnect stuff.
2753
2754         Reviewed by Chris.
2755
2756         * bindings/jni/jni_class.cpp:
2757         (JavaClass::classForName):
2758         (JavaClass::classForInstance):
2759         * bindings/jni/jni_instance.cpp:
2760         (JavaInstance::getValueOfField):
2761         * bindings/jni/jni_instance.h:
2762         (Bindings::JObjectWrapper::JObjectWrapper):
2763         * bindings/jni/jni_runtime.h:
2764         (Bindings::JavaConstructor::~JavaConstructor):
2765         (Bindings::JavaConstructor::operator=):
2766         (Bindings::JavaMethod::JavaMethod):
2767         (Bindings::JavaMethod::_commonDelete):
2768         (Bindings::JavaMethod::signature):
2769         * bindings/jni/jni_utility.cpp:
2770         (getJNIEnv):
2771         (attachToJavaVM):
2772         * bindings/jni/jni_utility.h:
2773         * bindings/runtime.h:
2774         * bindings/runtime_object.cpp:
2775         (RuntimeObjectImp::~RuntimeObjectImp):
2776         (RuntimeObjectImp::get):
2777         * bindings/runtime_object.h:
2778
2779 2003-11-19  Richard Williamson   <rjw@apple.com>
2780
2781         More LiveConnect stuff.
2782
2783         Reviewed by Ken.
2784
2785         * JavaScriptCore.pbproj/project.pbxproj:
2786         * bindings/jni/jni_class.cpp: Added.
2787         (JavaClass::_commonInit):
2788         (JavaClass::JavaClass):
2789         (_createClassesByNameIfNecessary):
2790         (JavaClass::classForName):
2791         (JavaClass::classForInstance):
2792         (JavaClass::methodNamed):
2793         (JavaClass::fieldNamed):
2794         * bindings/jni/jni_class.h: Added.
2795         (Bindings::JavaClass::_commonDelete):
2796         (Bindings::JavaClass::~JavaClass):
2797         (Bindings::JavaClass::_commonCopy):
2798         (Bindings::JavaClass::JavaClass):
2799         (Bindings::JavaClass::operator=):
2800         (Bindings::JavaClass::name):
2801         (Bindings::JavaClass::constructorAt):
2802         (Bindings::JavaClass::numConstructors):
2803         * bindings/jni/jni_instance.cpp: Added.
2804         (JavaInstance::JavaInstance):
2805         (JavaInstance::~JavaInstance):
2806         * bindings/jni/jni_instance.h: Added.
2807         (Bindings::JObjectWrapper::JObjectWrapper):
2808         (Bindings::JObjectWrapper::~JObjectWrapper):
2809         (Bindings::JObjectWrapper::ref):
2810         (Bindings::JObjectWrapper::deref):
2811         (Bindings::JavaInstance::getClass):
2812         (Bindings::JavaInstance::operator=):
2813         * bindings/jni/jni_runtime.cpp:
2814         (JavaMethod::JavaMethod):
2815         * bindings/jni/jni_runtime.h:
2816         (Bindings::JavaString::JavaString):
2817         (Bindings::JavaString::~JavaString):
2818         (Bindings::JavaString::operator=):
2819         * bindings/jni/jni_utility.cpp:
2820         (getJavaVM):
2821         (getJNIEnv):
2822         (getCharactersFromJString):
2823         (releaseCharactersForJString):
2824         (getCharactersFromJStringInEnv):
2825         (releaseCharactersForJStringInEnv):
2826         * bindings/jni/jni_utility.h:
2827         * bindings/runtime.cpp:
2828         (Instance::createBindingForLanguageInstance):
2829         * bindings/runtime.h:
2830         (Bindings::Instance::):
2831
2832 2003-11-18  Richard Williamson   <rjw@apple.com>
2833
2834         More live connect stubs.  We're getting close.
2835
2836         Reviewed by Chris.
2837
2838         * JavaScriptCore.pbproj/project.pbxproj:
2839         * bindings/jni/jni_runtime.cpp:
2840         (JavaClass::JavaClass):
2841         (JavaInstance::JavaInstance):
2842         (JavaInstance::~JavaInstance):
2843         * bindings/jni/jni_runtime.h:
2844         (Bindings::JavaConstructor::value):
2845         (Bindings::JavaField::value):
2846         (Bindings::JavaMethod::value):
2847         (Bindings::JavaClass::_commonDelete):
2848         (Bindings::JavaClass::_commonCopy):
2849         (Bindings::JavaClass::methodNamed):
2850         (Bindings::JavaClass::fieldNamed):
2851         (Bindings::JavaInstance::getClass):
2852         * bindings/runtime.cpp: Added.
2853         * bindings/runtime.h:
2854         (Bindings::Instance::~Instance):
2855         * bindings/runtime_object.cpp: Added.
2856         (RuntimeObjectImp::classInfo):
2857         (RuntimeObjectImp::RuntimeObjectImp):
2858         (RuntimeObjectImp::get):
2859         (RuntimeObjectImp::put):
2860         (RuntimeObjectImp::canPut):
2861         (RuntimeObjectImp::hasProperty):
2862         (RuntimeObjectImp::deleteProperty):
2863         (RuntimeObjectImp::defaultValue):
2864         (RuntimeObjectImp::_initializeClassInfoFromInstance):
2865         * bindings/runtime_object.h: Added.
2866         (KJS::RuntimeObjectImp::setInternalInstance):
2867         (KJS::RuntimeObjectImp::getInternalInstance):
2868         * kjs/object.cpp:
2869         (KJS::ObjectImp::get):
2870         (KJS::ObjectImp::hasProperty):
2871         * kjs/value.h:
2872         (KJS::):
2873
2874 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
2875
2876         Patch from Harri, reviewed by me.
2877
2878         - fixed 3487375 - backwards array slice causes infinite loop
2879         
2880         * kjs/array_object.cpp:
2881         (ArrayProtoFuncImp::call):
2882
2883 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
2884
2885         Patch from Harri Porten reviewed by me.
2886
2887         - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
2888
2889         * kjs/grammar.y: Correct the precedence.
2890
2891 2003-11-16  Maciej Stachowiak  <mjs@apple.com>
2892
2893         Reviewed by John.
2894
2895         - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
2896         
2897         * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
2898         warning flags.
2899
2900 === Safari-114 ===
2901
2902 2003-11-13  Richard Williamson   <rjw@apple.com>
2903
2904         Factored common code between copy constructor and assignment operator.
2905
2906         Reviewed by Chris.
2907
2908         * ChangeLog:
2909         * bindings/jni/jni_runtime.h:
2910         (Bindings::JavaConstructor::_commonCopy):
2911         (Bindings::JavaConstructor::JavaConstructor):
2912         (Bindings::JavaConstructor::operator=):
2913         (Bindings::JavaField::type):
2914         * bindings/runtime.h:
2915
2916 2003-11-13  Richard Williamson   <rjw@apple.com>
2917
2918         More LiveConnect stuff.  This checkin adds abstract classes to model
2919         language runtimes and a JNI based set of concrete implementations for
2920         Java.
2921
2922         Reviewed by Chris.
2923
2924         * JavaScriptCore.pbproj/project.pbxproj:
2925         * Makefile.am:
2926         * bindings/Makefile.am: Removed.
2927         * bindings/jni/Makefile.am: Removed.
2928         * bindings/jni/jni_runtime.cpp: Added.
2929         (JavaField::JavaField):
2930         (JavaConstructor::JavaConstructor):
2931         (JavaMethod::JavaMethod):
2932         (JavaClass::JavaClass):
2933         * bindings/jni/jni_runtime.h: Added.
2934         (Bindings::JavaString::JavaString):
2935         (Bindings::JavaString::~JavaString):
2936         (Bindings::JavaString::operator=):
2937         (Bindings::JavaString::characters):
2938         (Bindings::JavaParameter::JavaParameter):
2939         (Bindings::JavaParameter::~JavaParameter):
2940         (Bindings::JavaParameter::operator=):
2941         (Bindings::JavaParameter::type):
2942         (Bindings::JavaConstructor::JavaConstructor):
2943         (Bindings::JavaConstructor::~JavaConstructor):
2944         (Bindings::JavaConstructor::operator=):
2945         (Bindings::JavaConstructor::parameterAt):
2946         (Bindings::JavaConstructor::numParameters):
2947         (Bindings::JavaField::JavaField):
2948         (Bindings::JavaField::~JavaField):
2949         (Bindings::JavaField::operator=):
2950         (Bindings::JavaField::name):
2951         (Bindings::JavaField::type):
2952         (Bindings::JavaMethod::JavaMethod):
2953         (Bindings::JavaMethod::_commonDelete):
2954         (Bindings::JavaMethod::~JavaMethod):
2955         (Bindings::JavaMethod::_commonCopy):
2956         (Bindings::JavaMethod::operator=):
2957         (Bindings::JavaMethod::name):
2958         (Bindings::JavaMethod::returnType):
2959         (Bindings::JavaMethod::parameterAt):
2960         (Bindings::JavaMethod::numParameters):
2961         (Bindings::JavaClass::_commonDelete):
2962         (Bindings::JavaClass::~JavaClass):
2963         (Bindings::JavaClass::_commonCopy):
2964         (Bindings::JavaClass::JavaClass):
2965         (Bindings::JavaClass::operator=):
2966         (Bindings::JavaClass::name):
2967         (Bindings::JavaClass::methodAt):
2968         (Bindings::JavaClass::numMethods):
2969         (Bindings::JavaClass::constructorAt):
2970         (Bindings::JavaClass::numConstructors):
2971         (Bindings::JavaClass::fieldAt):
2972         (Bindings::JavaClass::numFields):
2973         * bindings/jni/jni_utility.cpp:
2974         (callJNIMethod):
2975         (callJNIMethodA):
2976         (callJNIObjectMethod):
2977         (callJNIByteMethod):
2978         (callJNICharMethod):
2979         (callJNIShortMethod):
2980         (callJNIIntMethod):
2981         (callJNILongMethod):
2982         (callJNIFloatMethod):
2983         (callJNIDoubleMethod):
2984         (callJNIVoidMethodA):
2985         (callJNIObjectMethodA):
2986         (callJNIByteMethodA):
2987         (callJNICharMethodA):
2988         (callJNIShortMethodA):
2989         (callJNIIntMethodA):
2990         (callJNILongMethodA):
2991         (callJNIFloatMethodA):
2992         (callJNIDoubleMethodA):
2993         (getCharactersFromJString):
2994         (releaseCharactersForJString):
2995         * bindings/jni/jni_utility.h:
2996         * bindings/objc/Makefile.am: Removed.
2997         * bindings/runtime.h: Added.
2998         (Bindings::Parameter::~Parameter):
2999         (Bindings::Constructor::~Constructor):
3000         (Bindings::Field::~Field):
3001         (Bindings::Method::~Method):
3002         (Bindings::Class::~Class):
3003
3004 2003-11-13  Maciej Stachowiak  <mjs@apple.com>
3005
3006         Reviewed by John.
3007
3008         - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
3009         
3010         * kjs/nodes.cpp:
3011         (ForInNode::execute): If the in value is null or undefined, bail
3012         out early, since attempting to iterate its properties will throw
3013         an exception.
3014
3015 2003-11-12  Darin Adler  <darin@apple.com>
3016
3017         - fixed the build
3018
3019         * Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
3020         Later, we can either add this back and add the Makefile.am files to the top
3021         level configure.in or leave it out and remove the Makefile.am files.
3022
3023 2003-11-12  Richard Williamson   <rjw@apple.com>
3024
3025         Added utility functions for calling JNI methods.
3026
3027         Reviewed by Chris.
3028
3029         * JavaScriptCore.pbproj/project.pbxproj:
3030         * Makefile.am:
3031         * bindings/Makefile.am: Added.
3032         * bindings/jni/Makefile.am: Added.
3033         * bindings/jni/jni_utility.cpp: Added.
3034         (attachToJavaVM):
3035         (callJNIMethod):
3036         (callJNIVoidMethod):
3037         (callJNIObjectMethod):
3038         (callJNIByteMethod):
3039         (callJNICharMethod):
3040         (callJNIShortMethod):
3041         (callJNIIntMethod):
3042         (callJNILongMethod):
3043         (callJNIFloatMethod):
3044         (callJNIDoubleMethod):
3045         * bindings/jni/jni_utility.h: Added.
3046         * bindings/objc/Makefile.am: Added.
3047
3048 2003-11-08  Darin Adler  <darin@apple.com>
3049
3050         Reviewed by John.
3051
3052         - fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
3053
3054         * kjs/array_object.cpp:
3055         (compareByStringForQSort): Added checks for undefined values to match what the specification calls for.
3056         (compareWithCompareFunctionForQSort): Added checks for undefined values as above, and also changed the
3057         code that looks at the compare function result to look at the number returned without rounding to an integer.
3058         (ArrayProtoFuncImp::call): Changed the code that looks at the compare function result to look at the number
3059         returned without rounding to an integer.
3060
3061 === Safari-113 ===
3062
3063 2003-11-03  Vicki Murley <vicki@apple.com>
3064
3065         Reviewed by kocienda.
3066
3067         - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
3068
3069         * JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
3070
3071 2003-11-02  Darin Adler  <darin@apple.com>
3072
3073         Reviewed by Maciej.
3074
3075         - changed list manipulation to use Harri Porten's idea of a circular
3076           linked list that is built from head to tail rather than building the
3077           list backwards and reversing the list when done
3078
3079         * kjs/grammar.y: Handle CatchNode and FinallyNode in a type-safe way.
3080         Change many places that passed 0L to pass nothing at all, or to pass 0.
3081
3082         * kjs/nodes.h:
3083         (KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
3084         backwards list.
3085         (KJS::ArrayNode::ArrayNode): Break the circular list instead of reversing the list.
3086         (KJS::PropertyValueNode::PropertyValueNode): Moved before ObjectLiteralNode so the
3087         inline code in ObjectLiteralNode works. Build a circular list instead of a 0-terminated
3088         backwards list. Made the case for the first node separate so we don't need a nil check.
3089         (KJS::ObjectLiteralNode::ObjectLiteralNode): Break the circular list instead of
3090         reversing the list.
3091         (KJS::ArgumentListNode::ArgumentListNode): Build a circular list instead of a 0-terminated
3092         backwards list. Also, made the constructors inline (moved here from .cpp file).
3093         (KJS::ArgumentsNode::ArgumentsNode): Break the circular list instead of
3094         reversing the list.
3095         (KJS::NewExprNode::NewExprNode): Changed a 0L to 0.
3096         (KJS::StatListNode::StatListNode): Make this constructor no longer inline (moved into
3097         .cpp file). The one in the .cpp file builds a circular list instead of a 0-terminated
3098         backwards list.
3099         (KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
3100         backwards list.
3101         (KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
3102         the list.
3103         (KJS::BlockNode::BlockNode): Make this constructor no longer inline (moved into .cpp file).
3104         The one in the .cpp file breaks the list instead of reversing it.
3105         (KJS::ForNode::ForNode): Break the circular list instead of reversing the list.
3106         (KJS::CaseClauseNode::CaseClauseNode): Break the circular list instead of reversing the
3107         list.
3108         (KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
3109         backwards list.
3110         (KJS::CaseBlockNode::CaseBlockNode): Make this constructor no longer inline (moved into
3111         .cpp file). The one in the .cpp file breaks the list instead of reversing it.
3112         (KJS::TryNode::TryNode): Changed constructor to take typed parameters for the catch and
3113         finally nodes rather than just Node.
3114         (KJS::ParameterNode::ParameterNode): Build a circular list instead of a 0-terminated
3115         backwards list.
3116         (KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
3117         list.
3118         (KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
3119         list.
3120
3121         * kjs/nodes.cpp:
3122         (StatListNode::StatListNode): Moved this constructor here, no longer inline.
3123         Did the "break circular list" thing instead of the "reverse list" thing.
3124         Added setLoc calls to match KJS in the KDE tree; since we don't currently
3125         use the JavaScript debugging support, it's unclear whether there's any benefit, but
3126         later we might be using it and it's good to be as close as possible.
3127         (BlockNode::BlockNode): Moved this constructor here, no longer inline.
3128         Did the "break circular list" thing instead of the "reverse list" thing.
3129         Added setLoc calls.
3130         (CaseBlockNode::CaseBlockNode): Moved this constructor here, no longer inline.
3131         Did the "break circular list" thing instead of the "reverse list" thing.
3132         (SourceElementsNode::SourceElementsNode): Moved this constructor here, no longer inline.
3133         Did the "break circular list" thing instead of the "reverse list" thing.
3134         Added setLoc calls.
3135
3136         * kjs/grammar.cpp: Regenerated.
3137         * kjs/grammar.cpp.h: Regenerated.
3138         * kjs/grammar.h: Regenerated.
3139
3140 === Safari-112 ===
3141
3142 2003-10-30  Maciej Stachowiak  <mjs@apple.com>
3143
3144         Reviewed by Ken.
3145
3146         - fixed 3427069 - browsing mp3.com causes leaks (KJS)
3147         
3148         * kjs/string_object.cpp:
3149         (StringProtoFuncImp::call): Don't do an early return, since that
3150         could leak a temporary regexp.
3151
3152 2003-10-29  Maciej Stachowiak  <mjs@apple.com>
3153
3154         Reviewed by Darin.
3155
3156         - fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
3157         
3158         * kjs/grammar.cpp:
3159         (yyerror): Updated the commented code.
3160         * kjs/grammar.y: Don't delete string and identifier tokens when done
3161         with them any more, they'll get cleaned up by the lexer now.
3162         * kjs/internal.cpp:
3163         (Parser::parse): Tell lexer when done parsing.
3164         * kjs/lexer.cpp:
3165         (Lexer::Lexer): Initialize new data members.
3166         (Lexer::lex): Use new methods to make strings and identifiers, and
3167         save them.
3168         (Lexer::makeIdentifier): Make a new Identifier and save it in an
3169         auto-growing array.
3170         (Lexer::makeUString): Likewise for UStrings.
3171         (Lexer::doneParsing): Clean up arrays of Ifentifiers and UStrings.
3172         * kjs/lexer.h:
3173
3174 2003-10-28  Maciej Stachowiak  <mjs@apple.com>
3175
3176         Reviewed by Ken.
3177
3178         - fixed 3413962 -  malicious web pages can kill all future JavaScript execution by breaking recursion limit check
3179         
3180         * kjs/nodes.cpp:
3181         (FunctionCallNode::evaluate): If we're going to return early due
3182         to breaking the recursion limit, make sure to lower it again, or
3183         it will creep up by one each time it's exceeded.
3184
3185 2003-10-26  Darin Adler  <darin@apple.com>
3186
3187         * JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
3188         as C++ in this project.
3189
3190 2003-10-26  Darin Adler  <darin@apple.com>
3191
3192         - rolled in some CString changes Harri Porten did on the KDE side
3193
3194         * kjs/ustring.cpp:
3195         (KJS::CString::CString): Use memcpy instead of strcpy for speed. Fix an off by one error
3196         in the copy constructor.
3197         (KJS::CString::operator=): Use memcpy instead of strcpy for speed.
3198
3199         * JavaScriptCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
3200         __null feature even if the system C library doesn't.
3201
3202 == Rolled over to ChangeLog-2003-10-25 ==