1 2005-04-14 Maciej Stachowiak <mjs@apple.com>
3 - make fast_malloc.h a private header, not project
5 * JavaScriptCore.pbproj/project.pbxproj:
7 2005-04-12 Maciej Stachowiak <mjs@apple.com>
11 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
13 - use custom single-threaded malloc for all non-GC JavaScriptCore
14 allocations, for a 9.1% speedup on JavaScript iBench
16 * JavaScriptCore.pbproj/project.pbxproj:
18 (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
19 (KJS::Collector::collect): And dlfree to free it.
20 * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
21 * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
22 macro to give a class custom operator new/delete
24 (KJS::Identifier::add): Use dlmalloc/dlfree.
25 * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
26 * kjs/property_map.cpp:
27 (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
28 (KJS::PropertyMap::rehash): ditto
31 (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
32 buffer, to hide allocation details from webcore.
33 (KJS::UString::UString): use createCopying when appropriate.
34 (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
35 (KJS::UString::expandedSize): likewise
36 (KJS::UString::expandCapacity): likewise
37 (KJS::UString::expandPreCapacity): likewise
38 (KJS::UString::spliceSubstringsWithSeparators): likewise
39 (KJS::UString::append): likewise
40 (KJS::UString::operator=): likewise
41 (KJS::UString::detach): likewise
42 * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
44 2005-04-11 Maciej Stachowiak <mjs@apple.com>
48 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
50 - Avoid using protected values hash for the two most common cases
51 - Bump up ListImp high water mark, new testing shows 508 ListImps are
52 created during JS iBench.
54 Net result is a 5.6% speedup on JavaScript iBench
57 (KJS::Collector::collect): mark protected lists as appropriate.
60 (KJS::ListImp::markValues): Moved implementation from List::markValues
61 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
63 (KJS::allocateListImp): link lists outside the pool into a separate
64 doubly linked list to be able to mark protected lists
65 (KJS::deallocateListImp): do the corresponding delinking
66 (KJS::List::derefValues): do nothing in conservative GC mode
67 (KJS::List::refValues): do nothing in conservative GC mode
68 (KJS::List::markValues): call ListImp version
84 2005-03-16 Jens Alfke <jens@apple.com>
88 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
89 JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
90 In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
91 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
94 (KJS::GlobalFuncImp::call):
96 2005-03-15 Richard Williamson <rjw@apple.com>
98 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
100 Added JavaScript boolean to type that can be converted to
101 ObjC scalar parameters.
103 Reviewed by Ken Kocienda.
105 * bindings/objc/objc_utility.mm:
106 (KJS::Bindings::convertValueToObjcValue):
122 2005-02-21 Darin Adler <darin@apple.com>
124 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
126 2005-02-17 Richard Williamson <rjw@apple.com>
128 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
132 Reviewed by John Sullivan.
134 * bindings/jni/jni_runtime.cpp:
135 (JavaField::valueFromInstance):
139 2005-02-11 Richard Williamson <rjw@apple.com>
141 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
143 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
144 creates these wrappers. The WebCore subclass of the interpreter now overrides
145 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
149 * bindings/c/c_utility.cpp:
150 (convertValueToNPVariant):
151 * bindings/jni/jni_instance.cpp:
152 (JavaInstance::invokeMethod):
153 * bindings/jni/jni_objc.mm:
154 (KJS::Bindings::dispatchJNICall):
155 * bindings/jni/jni_runtime.cpp:
156 (JavaField::valueFromInstance):
157 (JavaArray::valueAt):
158 * bindings/objc/WebScriptObject.mm:
159 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
160 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
161 * bindings/objc/WebScriptObjectPrivate.h:
162 * bindings/objc/objc_utility.h:
163 * bindings/objc/objc_utility.mm:
164 (KJS::Bindings::convertObjcValueToValue):
165 (KJS::Bindings::createObjcInstanceForValue):
166 * bindings/runtime.cpp:
167 (Instance::createBindingForLanguageInstance):
168 (Instance::createRuntimeObject):
169 (Instance::createLanguageInstanceForValue):
170 * bindings/runtime.h:
171 * kjs/interpreter.cpp:
172 (Interpreter::createLanguageInstanceForValue):
177 2005-02-10 Darin Adler <darin@apple.com>
179 "Reviewed" by Richard (he told me the file was obsolete).
181 - got rid of an obsolete file
183 * bindings/npsap.h: Removed.
189 2005-02-03 Richard Williamson <rjw@apple.com>
191 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
193 Revert to old (and correct) behavior of returning runtime object
194 when passed as a parameter, rather than it's corresponding DOM
199 * bindings/objc/WebScriptObject.mm:
200 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
204 2005-01-28 Richard Williamson <rjw@apple.com>
206 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
208 Only use special 'back door' property to get the runtime object if thisObj isn't
209 already a runtime object.
211 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
212 ClassInfo pointer instead.
216 * bindings/c/c_utility.cpp:
217 (convertValueToNPVariant):
218 * bindings/objc/WebScriptObject.mm:
219 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
220 * bindings/runtime_method.cpp:
221 (RuntimeMethodImp::call):
225 2005-01-26 Richard Williamson <rjw@apple.com>
227 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
229 I added a member variable to ObjectImp. This changed it's size and consequently
230 hampered the optimizations built into the garbage collector. Objects no longer
231 fit within the allocators cell size, and thus allocation fell back to a slower
234 As a result of this fix I also dramatically cleaned up how runtime objects are
235 accessed. The path mostly *removes* code.
239 * bindings/runtime_method.cpp:
240 (RuntimeMethodImp::call):
241 * bindings/runtime_object.cpp:
242 (RuntimeObjectImp::get):
243 (RuntimeObjectImp::put):
244 (RuntimeObjectImp::canPut):
245 (RuntimeObjectImp::hasProperty):
246 (RuntimeObjectImp::defaultValue):
247 * bindings/runtime_object.h:
249 (KJS::ObjectImp::ObjectImp):
252 2005-01-20 Darin Adler <darin@apple.com>
254 Reviewed by me, changes by Han Ming Ong.
256 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
258 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
259 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
261 2005-01-20 Richard Williamson <rjw@apple.com>
263 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
265 The comprehensive fix for this problem requires new API, as described in 3965326. However,
266 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
267 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
268 implemented on the bound object.
272 * bindings/objc/objc_runtime.h:
273 * bindings/objc/objc_runtime.mm:
274 (ObjcFallbackObjectImp::type):
275 (ObjcFallbackObjectImp::implementsCall):
276 (ObjcFallbackObjectImp::toBoolean):
277 * bindings/testbindings.mm:
278 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
279 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
283 2005-01-19 Richard Williamson <rjw@apple.com>
285 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
287 Fixed the following problems with LiveConnect that are demonstrated by the application
288 described in 3853676.
290 1. If a nil object is passed in an array from Java to JavaScript we will crash.
291 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
292 3. We will sometimes fail to find the correct static method ID.
296 * bindings/jni/jni_jsobject.cpp:
297 (JSObject::convertJObjectToValue):
298 (JSObject::listFromJArray):
299 * bindings/jni/jni_runtime.cpp:
300 (JavaField::valueFromInstance):
301 (JavaField::setValueToInstance):
302 * bindings/jni/jni_utility.cpp:
303 (KJS::Bindings::getMethodID):
304 (KJS::Bindings::convertValueToJValue):
305 * bindings/runtime_array.h:
307 2005-01-18 Richard Williamson <rjw@apple.com>
309 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
311 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
312 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
313 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
314 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
316 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
317 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
318 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
322 * bindings/objc/objc_instance.h:
323 * bindings/objc/objc_instance.mm:
324 (ObjcInstance::supportsSetValueOfUndefinedField):
325 * bindings/runtime.h:
326 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
327 * bindings/runtime_object.cpp:
328 (RuntimeObjectImp::RuntimeObjectImp):
329 (RuntimeObjectImp::get):
330 (RuntimeObjectImp::put):
331 (RuntimeObjectImp::canPut):
332 (RuntimeObjectImp::hasProperty):
333 (RuntimeObjectImp::defaultValue):
334 * bindings/runtime_object.h:
335 (KJS::RuntimeObjectImp::fallbackObject):
337 (KJS::ObjectImp::ObjectImp):
339 (KJS::ObjectImp::forwardingScriptMessage):
340 (KJS::ObjectImp::setForwardingScriptMessage):
342 2005-01-18 Richard Williamson <rjw@apple.com>
344 Back out a change that was incorrectly committed yesterday.
348 * bindings/objc/objc_utility.mm:
349 (KJS::Bindings::convertValueToObjcValue):
351 2005-01-17 Richard Williamson <rjw@apple.com>
353 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
355 Keep track of originating execution context and target execution
356 context for native JS object wrappers, and perform appropriate
359 Reviewed by David Harrison.
361 * bindings/NP_jsobject.cpp:
363 (_NPN_CreateScriptObject):
368 (_NPN_RemoveProperty):
372 * bindings/NP_jsobject.h:
373 * bindings/c/c_instance.cpp:
374 (CInstance::CInstance):
375 (CInstance::stringValue):
376 * bindings/c/c_instance.h:
377 * bindings/c/c_utility.cpp:
378 (convertValueToNPVariant):
379 * bindings/jni/jni_instance.cpp:
380 (JavaInstance::JavaInstance):
381 (JavaInstance::valueOf):
382 * bindings/jni/jni_instance.h:
383 * bindings/objc/WebScriptObject.mm:
384 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
385 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
386 (-[WebScriptObject KJS::Bindings::]):
387 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
388 (-[WebScriptObject _isSafeScript]):
389 (-[WebScriptObject callWebScriptMethod:withArguments:]):
390 (-[WebScriptObject evaluateWebScript:]):
391 (-[WebScriptObject setValue:forKey:]):
392 (-[WebScriptObject valueForKey:]):
393 (-[WebScriptObject removeWebScriptKey:]):
394 (-[WebScriptObject stringRepresentation]):
395 (-[WebScriptObject webScriptValueAtIndex:]):
396 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
397 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
398 * bindings/objc/WebScriptObjectPrivate.h:
399 * bindings/objc/objc_instance.h:
400 * bindings/objc/objc_runtime.mm:
401 (convertValueToObjcObject):
402 * bindings/objc/objc_utility.mm:
403 (KJS::Bindings::convertValueToObjcValue):
404 * bindings/runtime.cpp:
405 (Instance::Instance):
406 (Instance::operator=):
407 * bindings/runtime.h:
408 (KJS::Bindings::Instance::Instance):
409 (KJS::Bindings::Instance::setExecutionContext):
410 (KJS::Bindings::Instance::executionContext):
411 * bindings/runtime_root.cpp:
412 (RootObject::setInterpreter):
413 * bindings/runtime_root.h:
415 (KJS::Interpreter::isGlobalObject):
416 (KJS::Interpreter::interpreterForGlobalObject):
417 (KJS::Interpreter::isSafeScript):
421 2005-01-13 Vicki Murley <vicki@apple.com>
425 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
427 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
429 2005-01-12 Richard Williamson <rjw@apple.com>
431 Avoid additional work on dealloc by adding early out to
432 removeNativeReference(). (This will save time on dealloc
433 for all ObjC DOM objects.)
437 * bindings/runtime_root.cpp:
438 (KJS::Bindings::removeNativeReference):
440 2005-01-12 Richard Williamson <rjw@apple.com>
442 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
444 We were always returning the first "root" object for all runtime
445 objects. Changed 0 in loop to i, the index.
447 Reviewed by David Harrison.
449 * bindings/runtime_root.cpp:
450 (KJS::Bindings::rootForImp):
452 2005-01-11 Richard Williamson <rjw@apple.com>
454 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
456 Use the new dispatching API to invoke JNI, rather than calling JNI
459 Reviewed by David Harrison.
461 * bindings/jni/jni_instance.cpp:
462 (JavaInstance::invokeMethod):
463 * bindings/jni/jni_runtime.cpp:
464 (JavaField::dispatchValueFromInstance):
465 (JavaField::valueFromInstance):
466 (JavaField::dispatchSetValueToInstance):
467 (JavaField::setValueToInstance):
468 * bindings/jni/jni_runtime.h:
469 * bindings/jni/jni_utility.cpp:
470 (KJS::Bindings::convertValueToJValue):
478 2004-12-17 Maciej Stachowiak <mjs@apple.com>
482 <rdar://problem/3926869> Opening caches window after running PLT causes crash
484 * kjs/protected_values.cpp:
485 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
486 the protected value table.
487 (KJS::ProtectedValues::increaseProtectCount): Ditto.
488 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
490 2004-12-16 Darin Adler <darin@apple.com>
494 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
496 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
497 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
498 non-locale-specific versions.
499 * kjs/string_object.lut.h: Regenerated.
501 2004-12-14 Richard Williamson <rjw@apple.com>
503 Pass URL of plugin view when call into JNI.
507 * bindings/jni/jni_objc.mm:
508 (KJS::Bindings::dispatchJNICall):
510 2004-12-13 Richard Williamson <rjw@apple.com>
512 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
514 Add support for calling static Java methods from JavaScript.
518 * bindings/jni/jni_instance.cpp:
519 (JavaInstance::invokeMethod):
520 * bindings/jni/jni_runtime.cpp:
521 (JavaMethod::JavaMethod):
522 * bindings/jni/jni_runtime.h:
523 (KJS::Bindings::JavaMethod::isStatic):
524 * bindings/jni/jni_utility.cpp:
525 (callJNIStaticMethod):
526 (KJS::Bindings::callJNIBooleanMethod):
527 (KJS::Bindings::callJNIStaticBooleanMethod):
528 * bindings/jni/jni_utility.h:
530 2004-12-13 Richard Williamson <rjw@apple.com>
532 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
536 * bindings/jni/jni_instance.cpp:
537 (JavaInstance::invokeMethod):
538 * bindings/jni/jni_objc.mm:
539 (KJS::Bindings::dispatchJNICall):
540 * bindings/jni/jni_runtime.h:
541 * bindings/jni/jni_utility.h:
545 2004-12-07 Maciej Stachowiak <mjs@apple.com>
549 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
551 The fix was to implement copy constructor and assignment operator,
552 the ones that worked on the base class did not replace the
556 (KJS::ProtectedValue::ProtectedValue):
557 (KJS::ProtectedValue::operator=):
558 (KJS::ProtectedObject::ProtectedObject):
559 (KJS::ProtectedObject::operator=):
561 Also fixed a bug in the GC test mode that compares the results of
562 the old collector and the new collector.
569 2004-11-23 Richard Williamson <rjw@apple.com>
571 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
575 * bindings/c/c_class.cpp:
576 (CClass::_commonInit):
578 2004-11-21 Maciej Stachowiak <mjs@apple.com>
582 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
585 (KJS::Collector::Thread::Thread):
586 (KJS::destroyRegisteredThread):
587 (KJS::initializeRegisteredThreadKey):
588 (KJS::Collector::registerThread):
589 (KJS::Collector::markStackObjectsConservatively):
590 (KJS::Collector::markCurrentThreadConservatively):
591 (KJS::Collector::markOtherThreadConservatively):
599 2004-11-15 Richard Williamson <rjw@apple.com>
601 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
605 * bindings/objc/objc_instance.mm:
606 (ObjcInstance::stringValue):
607 * bindings/objc/objc_utility.h:
608 * bindings/objc/objc_utility.mm:
609 (KJS::Bindings::convertNSStringToString):
610 (KJS::Bindings::convertObjcValueToValue):
614 2004-11-09 Chris Blumenberg <cblu@apple.com>
616 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
621 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
622 * bindings/softlinking.c: Added.
624 (getFunctionPointer): new
625 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
629 2004-11-04 Darin Adler <darin@apple.com>
633 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
634 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
635 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
636 than allocating a new one
638 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
639 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
640 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
641 actually allocate only the very first time it's called.
642 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
643 shared instance since there can be only one).
644 (-[WebUndefined copyWithZone:]): Ditto.
645 (-[WebUndefined retain]): Ditto.
646 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
648 (-[WebUndefined autorelease]): Simplified to just return self (see above).
649 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
650 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
651 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
652 bug mentioned above).
653 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
654 No need to call init, since that's a no-op for this class.
656 2004-11-03 David Harrison <harrison@apple.com>
660 Eliminate the use of a marker file to determine how to build.
665 2004-11-01 Richard Williamson <rjw@apple.com>
667 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
671 * bindings/c/c_instance.cpp:
672 (CInstance::invokeMethod):
673 (CInstance::invokeDefaultMethod):
674 Initialize out parameters to void type.
676 * bindings/c/c_runtime.cpp:
677 (CField::valueFromInstance):
678 (CField::setValueToInstance):
679 Initialize out parameters to void type.
680 Also added additional checks to protect against classes that
681 don't implement all functions.
683 2004-11-01 Richard Williamson <rjw@apple.com>
685 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
690 * bindings/objc/WebScriptObject.mm:
691 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
692 Added additional conversion Undefined -> WebUndefined.
693 * bindings/objc/objc_utility.mm:
694 (KJS::Bindings::convertObjcValueToValue):
695 Added additional conversion WebUndefined -> Undefined.
697 2004-11-01 Darin Adler <darin@apple.com>
699 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
701 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
702 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
703 report to match the contents of the file.
709 2004-10-22 Ken Kocienda <kocienda@apple.com>
713 * JavaScriptCore.pbproj/project.pbxproj:
714 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
718 2004-10-13 Richard Williamson <rjw@apple.com>
720 Moved boolean checks prior to NSNumber checks. booleans are
723 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
727 * bindings/objc/objc_utility.mm:
728 (KJS::Bindings::convertObjcValueToValue):
730 2004-10-12 Richard Williamson <rjw@apple.com>
732 Fixed access to DOM object via WebScriptObject API.
733 The execution context for DOM objects wasn't being found.
734 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
738 * bindings/objc/WebScriptObject.mm:
740 (-[WebScriptObject KJS::Bindings::]):
741 (-[WebScriptObject callWebScriptMethod:withArguments:]):
742 (-[WebScriptObject evaluateWebScript:]):
743 (-[WebScriptObject setValue:forKey:]):
744 (-[WebScriptObject valueForKey:]):
745 (-[WebScriptObject stringRepresentation]):
746 * bindings/objc/WebScriptObjectPrivate.h:
748 2004-10-09 Darin Adler <darin@apple.com>
752 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
754 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
755 creating an init routine.
757 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
758 require a global constructor that creates an init routine.
760 2004-10-09 Darin Adler <darin@apple.com>
764 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
766 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
767 work with the window object of the page the function is in, not the page of the caller. This
768 is what all other browsers do. This code was hidden before by the "everything is defined on
769 window object" hack in WebCore.
771 2004-10-07 Richard Williamson <rjw@apple.com>
773 Added simple JavaScript call tracing. Very useful for
774 debugging complex pages.
776 Tracing is only available in development builds and is
779 (gdb) set traceJavaScript = 1
783 setTraceJavaScript(true)
785 Function, args, and return values are printed to console. Very
790 * kjs/function_object.cpp:
791 (FunctionProtoFuncImp::call):
797 2004-10-05 Richard Williamson <rjw@apple.com>
799 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
803 * bindings/NP_jsobject.cpp:
805 * bindings/npruntime.cpp:
806 (_NPN_SetExceptionWithUTF8):
807 * bindings/objc/WebScriptObject.mm:
808 (+[WebScriptObject throwException:]):
810 (KJS::InterpreterImp::context):
812 2004-10-05 Richard Williamson <rjw@apple.com>
814 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
818 * bindings/objc/objc_utility.mm:
819 (KJS::Bindings::convertObjcValueToValue):
821 2004-10-04 Darin Adler <darin@apple.com>
825 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
827 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
829 - rolled out an old workaround we don't need any more
831 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
832 required it is no longer there.
834 2004-09-30 Richard Williamson <rjw@apple.com>
836 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
840 * bindings/NP_jsobject.cpp:
844 * bindings/c/c_class.cpp:
845 (CClass::methodsNamed):
846 (CClass::fieldNamed):
847 * bindings/c/c_class.h:
848 * bindings/c/c_instance.cpp:
849 (CInstance::invokeMethod):
850 * bindings/jni/jni_class.cpp:
851 (JavaClass::methodsNamed):
852 * bindings/jni/jni_class.h:
853 * bindings/npruntime.h:
854 * bindings/objc/objc_class.h:
855 * bindings/objc/objc_class.mm:
856 (ObjcClass::methodsNamed):
857 * bindings/runtime.h:
858 * bindings/runtime_object.cpp:
859 (RuntimeObjectImp::get):
860 (RuntimeObjectImp::hasProperty):
862 2004-09-29 Chris Blumenberg <cblu@apple.com>
864 Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
868 * JavaScriptCore.pbproj/project.pbxproj:
869 * bindings/NP_jsobject.cpp:
870 (_NPN_CreateScriptObject):
871 (_NPN_InvokeDefault):
876 (_NPN_RemoveProperty):
879 * bindings/c/c_class.cpp:
880 (CClass::methodsNamed):
881 (CClass::fieldNamed):
882 * bindings/c/c_instance.cpp:
883 (CInstance::CInstance):
884 (CInstance::~CInstance):
885 (CInstance::operator=):
886 (CInstance::invokeMethod):
887 (CInstance::invokeDefaultMethod):
888 * bindings/c/c_runtime.cpp:
889 * bindings/c/c_runtime.h:
890 (KJS::Bindings::CField::name):
891 (KJS::Bindings::CMethod::name):
892 * bindings/npruntime.cpp:
893 (_NPN_GetStringIdentifier):
894 (_NPN_GetStringIdentifiers):
895 (_NPN_GetIntIdentifier):
896 (_NPN_IdentifierIsString):
897 (_NPN_UTF8FromIdentifier):
898 (_NPN_IntFromIdentifier):
899 (NPN_InitializeVariantWithObject):
900 (_NPN_ReleaseVariantValue):
903 (_NPN_ReleaseObject):
904 (_NPN_SetExceptionWithUTF8):
907 2004-09-26 Darin Adler <darin@apple.com>
909 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
910 low() to get Unicode value of character, and just use unicode().
912 2004-09-26 Darin Adler <darin@apple.com>
914 - refine charAt/charCodeAt fix slightly
916 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
917 omitted parameter, as we do everywhere else, and as other browsers do here.
919 2004-09-26 Darin Adler <darin@apple.com>
923 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
925 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
926 the program. We were doing this properly for functions, but not entire programs.
928 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
930 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
931 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
933 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
939 2004-09-14 Richard Williamson <rjw@apple.com>
941 1. Add class parameter to object allocation function. This is somewhat redundant, given that
942 the allocation function is in the class function vector, but people wanted to use the same
943 allocation function for different classes.
945 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
947 3. Add support for a default function on an object. This is a feature that ActiveX supports,
948 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
949 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
950 'Objective-C' bindings.
952 There bugs are covered by
954 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
955 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
956 <rdar://problem/3674754> Need to implement latest npruntime.h
960 * bindings/NP_jsobject.cpp:
964 * bindings/c/c_class.cpp:
965 * bindings/c/c_instance.cpp:
966 (CInstance::CInstance):
967 (CInstance::operator=):
968 (CInstance::invokeMethod):
969 (CInstance::invokeDefaultMethod):
970 * bindings/c/c_instance.h:
971 * bindings/c/c_runtime.cpp:
972 * bindings/c/c_runtime.h:
973 * bindings/jni/jni_instance.cpp:
974 (JavaInstance::invokeDefaultMethod):
975 * bindings/jni/jni_instance.h:
976 * bindings/npruntime.cpp:
978 * bindings/npruntime.h:
979 * bindings/objc/WebScriptObject.h:
980 * bindings/objc/objc_class.mm:
981 (ObjcClass::fallbackObject):
982 * bindings/objc/objc_instance.h:
983 * bindings/objc/objc_instance.mm:
984 (ObjcInstance::invokeDefaultMethod):
985 * bindings/objc/objc_runtime.h:
986 * bindings/objc/objc_runtime.mm:
987 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
988 (ObjcFallbackObjectImp::get):
989 (ObjcFallbackObjectImp::put):
990 (ObjcFallbackObjectImp::canPut):
991 (ObjcFallbackObjectImp::implementsCall):
992 (ObjcFallbackObjectImp::call):
993 (ObjcFallbackObjectImp::hasProperty):
994 (ObjcFallbackObjectImp::deleteProperty):
995 (ObjcFallbackObjectImp::defaultValue):
996 * bindings/runtime.h:
997 (KJS::Bindings::Class::fallbackObject):
998 (KJS::Bindings::Instance::getValueOfUndefinedField):
999 (KJS::Bindings::Instance::setValueOfUndefinedField):
1000 (KJS::Bindings::Instance::valueOf):
1001 * bindings/runtime_object.cpp:
1002 (RuntimeObjectImp::implementsCall):
1003 (RuntimeObjectImp::call):
1004 * bindings/runtime_object.h:
1006 2004-09-13 Maciej Stachowiak <mjs@apple.com>
1010 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1012 * kjs/string_object.cpp:
1013 (StringProtoFuncImp::call): Replaced implementation of replace()
1014 method with function below...
1015 (replace): In order to avoid excessive allocation and copying,
1016 figure out the ranges of the original string and replacement
1017 strings to be assembled, instead of constantly creating new
1018 strings at each substitution. The old behavior is basically O(N^2)
1019 for a global replace on a pattern that matches many places in the
1021 (regExpIsGlobal): Helper function for the above.
1022 (expandSourceRanges): ditto
1023 (pushSourceRange): ditto
1024 (expandReplacements): ditto
1025 (pushReplacement): ditto
1027 (KJS::UString::spliceSubstringsWithSeparators): New method that
1028 pieces together substring ranges of this string together with
1029 specified separators, all at one go.
1031 (KJS::UString::Range::Range): Added new helper class to represent
1034 2004-09-14 Maciej Stachowiak <mjs@apple.com>
1038 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1041 (KJS::GlobalFuncImp::call): Make sure to escape null
1042 characters. This is a bug in the new code that made part of the
1045 2004-09-13 Darin Adler <darin@apple.com>
1047 Reviewed by Kevin and Maciej.
1049 - new function to support fix for DIG bug in WebCore
1051 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1052 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1054 2004-09-12 Darin Adler <darin@apple.com>
1056 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1057 of escape and unescape.
1059 2004-09-12 Darin Adler <darin@apple.com>
1063 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1065 * kjs/date_object.cpp:
1066 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1067 uses CFDateFormatter.
1068 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1070 2004-09-09 Maciej Stachowiak <mjs@apple.com>
1072 Reviewed by Richard.
1074 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1077 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1078 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1080 (Lexer::isHexDigit): Made static and non-const.
1085 2004-09-06 Darin Adler <darin@apple.com>
1087 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1091 2004-09-01 Richard Williamson <rjw@apple.com>
1093 Add pid to exception messages (to help debug dashboard clients).
1097 * kjs/interpreter.cpp:
1098 (Interpreter::evaluate):
1102 2004-08-20 Richard Williamson <rjw@apple.com>
1104 Implemented new JNI abstraction. We no longer invoke Java methods
1105 directly with JNI, rather we call into the plugin. This allows the
1106 plugin to dispatch the call to the appropriate VM thread. This
1107 change should (will?) fix a whole class of threading related problems with
1112 * JavaScriptCore.pbproj/project.pbxproj:
1113 * bindings/c/c_instance.h:
1114 (KJS::Bindings::CInstance::setExecutionContext):
1115 (KJS::Bindings::CInstance::executionContext):
1116 * bindings/jni/jni_instance.cpp:
1117 (JavaInstance::JavaInstance):
1118 (JavaInstance::invokeMethod):
1119 (JavaInstance::setExecutionContext):
1120 (JavaInstance::executionContext):
1121 * bindings/jni/jni_instance.h:
1122 * bindings/jni/jni_jsobject.cpp:
1123 (JSObject::convertJObjectToValue):
1124 * bindings/jni/jni_runtime.cpp:
1125 (JavaField::JavaField):
1126 (JavaArray::convertJObjectToArray):
1127 (JavaField::valueFromInstance):
1128 (JavaArray::JavaArray):
1129 (JavaArray::valueAt):
1130 * bindings/jni/jni_runtime.h:
1131 (KJS::Bindings::JavaArray::operator=):
1132 (KJS::Bindings::JavaArray::executionContext):
1133 * bindings/jni/jni_utility.h:
1134 * bindings/objc/objc_instance.h:
1135 (KJS::Bindings::ObjcInstance::setExecutionContext):
1136 (KJS::Bindings::ObjcInstance::executionContext):
1137 * bindings/runtime.cpp:
1138 (Instance::createBindingForLanguageInstance):
1139 * bindings/runtime.h:
1140 * bindings/runtime_root.h:
1141 (KJS::Bindings::RootObject::nativeHandle):
1145 2004-08-19 Vicki Murley <vicki@apple.com>
1149 * kjs/property_map.cpp:
1150 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1152 2004-08-17 Darin Adler <darin@apple.com>
1156 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1158 * kjs/property_map.h: Added some private functions.
1159 * kjs/property_map.cpp:
1160 (KJS::PropertyMap::clear): Set sentinelCount to 0.
1161 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1162 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1163 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1164 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1165 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1166 deleted-element sentinels.
1167 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1169 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1171 Code change by Eric Albert, reviewd by me.
1173 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1175 * kjs/date_object.cpp:
1176 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1177 entirely would be even better, but is not required to fix this bug.
1181 2004-08-16 Richard Williamson <rjw@apple.com>
1183 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1185 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1189 * bindings/NP_jsobject.cpp:
1191 * bindings/jni/jni_jsobject.cpp:
1193 * bindings/objc/WebScriptObject.mm:
1194 (-[WebScriptObject evaluateWebScript:]):
1196 2004-08-15 Richard Williamson <rjw@apple.com>
1198 More updates to np headers. Implemented new NPN functions.
1202 * bindings/NP_jsobject.cpp:
1206 * bindings/npruntime.h:
1208 2004-08-13 Darin Adler <darin@apple.com>
1210 - fix build so we can compile again
1212 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1213 is good enough so that we can compile, but it's only a stopgap measure, because I think
1214 Richard has a newer one he wants to check in.
1216 2004-08-12 Richard Williamson <rjw@apple.com>
1218 Bring npruntime.h and friends closer to compliance with
1223 * JavaScriptCore.pbproj/project.pbxproj:
1224 * bindings/NP_jsobject.cpp:
1226 (_NPN_CreateScriptObject):
1231 (NPN_RemoveProperty):
1232 * bindings/NP_jsobject.h:
1233 * bindings/c/c_instance.cpp:
1234 (CInstance::invokeMethod):
1235 * bindings/c/c_utility.cpp:
1236 (convertNPVariantToValue):
1237 * bindings/npruntime.cpp:
1238 (NPN_IdentifierIsString):
1239 (NPN_VariantIsVoid):
1240 (NPN_VariantIsNull):
1241 (NPN_VariantIsUndefined):
1242 (NPN_VariantIsBool):
1243 (NPN_VariantIsInt32):
1244 (NPN_VariantIsDouble):
1245 (NPN_VariantIsString):
1246 (NPN_VariantIsObject):
1247 (NPN_VariantToBool):
1248 (NPN_VariantToString):
1249 (NPN_VariantToInt32):
1250 (NPN_VariantToDouble):
1251 (NPN_VariantToObject):
1252 (NPN_InitializeVariantAsVoid):
1253 (NPN_InitializeVariantAsNull):
1254 (NPN_InitializeVariantAsUndefined):
1255 (NPN_InitializeVariantWithBool):
1256 (NPN_InitializeVariantWithInt32):
1257 (NPN_InitializeVariantWithDouble):
1258 (NPN_InitializeVariantWithString):
1259 (NPN_InitializeVariantWithStringCopy):
1260 (NPN_InitializeVariantWithObject):
1261 (NPN_InitializeVariantWithVariant):
1262 (NPN_ReleaseVariantValue):
1264 * bindings/npruntime.h:
1266 (_NPString::_NPVariant::):
1267 * bindings/npruntime_priv.h: Added.
1269 2004-08-12 Darin Adler <darin@apple.com>
1273 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1276 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1277 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1278 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1279 to skip leading "+" or "-".
1283 2004-08-12 Darin Adler <darin@apple.com>
1287 - fixed 43 Mozilla JavaScript tests
1289 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1290 * kjs/date_object.cpp:
1291 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1292 than constructing a number object to pass to it.
1293 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1294 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1295 (KJS::timeClip): Implement this as specified in the language standard.
1297 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1298 flags on the prototype property.
1301 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1303 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1305 (KJS::parseDigit): Added. Helper function for parseInt.
1306 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1307 strtoll can handle. Also matches standard more closely.
1308 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1310 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1312 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1314 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1316 (Lexer::setCode): Clear error state.
1317 (Lexer::lex): Set error state if the lexer encounters an error
1320 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1321 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1323 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1324 Change round to round values between -0.5 and -0 to -0 instead of +0.
1326 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1327 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1328 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1329 would change x.y into a value that can't be deleted as a side effect.
1331 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1334 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1335 get rid of the fixed size limit for code.
1337 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1338 returns the string without creating a new Rep, since I'm using substr in a place where it will
1339 often be passed a 0.
1341 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1342 the other day that was making a couple tests fail.
1343 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1344 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1345 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1346 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1347 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1349 * kjs/string_object.lut.h: Regenerated.
1351 2004-08-11 Darin Adler <darin@apple.com>
1353 - fixed a tiny problem with the UTF-16 PCRE check-in
1355 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1356 the ctype_meta flag to get set in items that should not have it.
1358 * pcre/chartables.c: Regenerated.
1360 2004-08-10 Richard Williamson <rjw@apple.com>
1362 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1364 The following WebScripting methods are now supported on bound
1367 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1368 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1369 - (id)valueForUndefinedKey:(NSString *)key
1373 * bindings/c/c_class.cpp:
1374 (CClass::fieldNamed):
1375 * bindings/c/c_class.h:
1376 * bindings/jni/jni_class.cpp:
1377 (JavaClass::fieldNamed):
1378 * bindings/jni/jni_class.h:
1379 * bindings/objc/objc_class.h:
1380 (KJS::Bindings::ObjcClass::isa):
1381 * bindings/objc/objc_class.mm:
1382 (ObjcClass::methodsNamed):
1383 (ObjcClass::fieldNamed):
1384 (ObjcClass::fallbackObject):
1385 * bindings/objc/objc_instance.h:
1386 * bindings/objc/objc_instance.mm:
1387 (ObjcInstance::invokeMethod):
1388 (ObjcInstance::setValueOfField):
1389 (ObjcInstance::setValueOfUndefinedField):
1390 (ObjcInstance::getValueOfField):
1391 (ObjcInstance::getValueOfUndefinedField):
1392 * bindings/objc/objc_runtime.h:
1393 (KJS::Bindings::ObjcField::~ObjcField):
1394 (KJS::Bindings::ObjcField::ObjcField):
1395 (KJS::Bindings::ObjcField::operator=):
1396 (KJS::Bindings::FallbackObjectImp::classInfo):
1397 * bindings/objc/objc_runtime.mm:
1398 (ObjcField::ObjcField):
1401 (ObjcField::valueFromInstance):
1402 (ObjcField::setValueToInstance):
1403 (FallbackObjectImp::FallbackObjectImp):
1404 (FallbackObjectImp::get):
1405 (FallbackObjectImp::put):
1406 (FallbackObjectImp::canPut):
1407 (FallbackObjectImp::implementsCall):
1408 (FallbackObjectImp::call):
1409 (FallbackObjectImp::hasProperty):
1410 (FallbackObjectImp::deleteProperty):
1411 (FallbackObjectImp::defaultValue):
1412 * bindings/runtime.h:
1413 (KJS::Bindings::Class::fallbackObject):
1414 (KJS::Bindings::Instance::getValueOfUndefinedField):
1415 (KJS::Bindings::Instance::setValueOfUndefinedField):
1416 * bindings/runtime_object.cpp:
1417 (RuntimeObjectImp::get):
1418 (RuntimeObjectImp::put):
1419 (RuntimeObjectImp::canPut):
1420 (RuntimeObjectImp::hasProperty):
1421 * bindings/testbindings.mm:
1422 (-[MyFirstInterface valueForUndefinedKey:]):
1423 (-[MyFirstInterface setValue:forUndefinedKey:]):
1425 2004-08-10 Darin Adler <darin@apple.com>
1429 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1431 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1432 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1433 that need to use it.
1434 * pcre/pcre.c: Add UTF-16 support to all functions.
1435 * pcre/study.c: Ditto.
1437 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1438 the mode. Changed declarations to use symbolic constants and typedefs so we size
1439 things to ichar when needed.
1441 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1442 sized to 16-bit characters instead of 8-bit.
1445 (pcre_copy_substring): Use pcre_char instead of char.
1446 (pcre_get_substring_list): Ditto.
1447 (pcre_free_substring_list): Ditto.
1448 (pcre_get_substring): Ditto.
1449 (pcre_free_substring): Ditto.
1451 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1452 of hard-coding 8-bit table sizes.
1454 * pcre/chartables.c: Regenerated.
1456 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1457 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1458 is not null. The null string still has a null pointer. This prevents us from
1459 passing a null through to the regular expression engine (which results in a null
1460 error even when the string length is 0).
1463 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1464 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1466 2004-08-09 Darin Adler <darin@apple.com>
1470 - fixed 28 Mozilla JavaScript tests
1472 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1473 checking the number of arguments for the join method.
1475 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1476 than integers, so we aren't limited to 32 bits.
1478 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1479 the implementation of the pow operation. Also simplied a case that was handling positive
1480 and negative infinity separately.
1482 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1483 putting them in a long, so that unsigned shift will work properly.
1485 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1487 * kjs/operations.cpp:
1488 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1489 sign of isinf; our isinf function returns +1 even for negative infinity.
1490 (KJS::isNegInf): And again.
1491 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1492 Our floating point already handles the various infinity cases correctly.
1494 * kjs/regexp_object.cpp:
1495 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1496 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1497 array in cases where we did not match.
1498 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1499 "global", "ignoreCase", "multiline", and "source".
1501 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1502 string into undefined rather than an empty string. For the slice method, handle an
1503 undefined parameter for the limit properly as decribed in the specification, and add
1504 the limit to one case that didn't have the limit at all. For the methods that generate
1505 HTML strings, use lowercase tags instead of uppercase.
1508 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1509 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1510 (KJS::UString::append): Fix some math that caused a buffer overflow.
1511 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1512 flag) rather than converting them all to 0.
1513 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1515 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1517 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1518 the Unicode specification in a few cases where it was wrong before.
1519 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1520 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1521 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1522 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1523 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1524 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1525 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1526 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1527 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1529 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1531 * kjs/number_object.lut.h: Regenerated.
1533 2004-08-09 Darin Adler <darin@apple.com>
1537 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1539 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1540 we get a buffer overflow.
1544 2004-08-05 Richard Williamson <rjw@apple.com>
1546 Fixed part of 3674747. The QT guys need this for feature freeze.
1548 This patch implements support for the
1550 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1552 method of objects bound to JavaScript.
1557 * bindings/objc/objc_class.mm:
1558 (ObjcClass::methodsNamed):
1559 (ObjcClass::fieldNamed):
1560 * bindings/objc/objc_instance.mm:
1561 (ObjcInstance::invokeMethod):
1562 * bindings/objc/objc_runtime.h:
1563 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1564 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1565 (KJS::Bindings::ObjcMethod::javaScriptName):
1566 * bindings/objc/objc_runtime.mm:
1567 (ObjcMethod::ObjcMethod):
1568 (ObjcMethod::getMethodSignature):
1569 (ObjcMethod::setJavaScriptName):
1570 * bindings/testbindings.mm:
1572 2004-08-04 Vicki Murley <vicki@apple.com>
1576 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1579 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1580 go to the next line and continue parsing the string (instead of failing). This matches
1581 behavior in Mac IE and Mozilla.
1583 2004-08-03 Kevin Decker <kdecker@apple.com>
1587 Rolled in changes from the latest KJS sources that support additional
1588 Number.prototype functions.
1590 Specifically this patch covers the follow parts of the ECMA 3 spec:
1591 15.7.4.5, 15.7.4.6, and 15.7.4.7
1594 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1595 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1596 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1598 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1599 list of supported identifiers (a macro).
1600 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1601 and toExponential().
1602 (NumberPrototypeImp::NumberPrototypeImp):
1603 (NumberProtoFuncImp::call):
1604 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1606 (KJS::NumberProtoFuncImp::):
1607 * tests/mozilla/expected.html: Update results.
1609 2004-08-03 Darin Adler <darin@apple.com>
1613 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1615 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1616 we are supposed to just copy the regular expression object, and do so.
1617 Also tighten up arguments check to handle case where an actual "undefined"
1618 is passed rather than just omitting an argument.
1620 * tests/mozilla/expected.html: Update results.
1622 2004-08-02 Darin Adler <darin@apple.com>
1624 * tests/mozilla/.cvsignore: Added.
1625 * tests/mozilla/expected.html: Update results.
1627 2004-08-02 Darin Adler <darin@apple.com>
1631 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1633 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1634 Append the flags here so more tests paseed.
1636 2004-08-02 Darin Adler <darin@apple.com>
1640 - fixed a couple things making 5 Mozilla regexp tests pass
1642 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1644 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1645 be used as the flags string when no parameter was passed.
1647 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1648 Added a class info object for RegExp prototype so it can return
1649 a string instead of raising an exception when converting to a string.
1651 * tests/mozilla/expected.html: Update results.
1653 2004-08-02 Darin Adler <darin@apple.com>
1657 - fix crashes in mozilla tests due to mishandling NaN
1659 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1660 calls to toInteger so that NaN will get turned into something that fits in an integer.
1661 These were the ones John already fixed, but his fix used isnan and the new fix is
1664 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1665 after a call to toInteger to handle NaN properly. Also removed separate check
1666 for undefined that's not needed.
1668 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1669 as in the above two files, but for a lot more functions. Also changed one place with
1670 an explicit check for undefined to instead just check isNaN.
1672 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1673 like me who don't keep $SYMROOTS in their $PATH.
1679 2004-07-26 Kevin Decker <kdecker@apple.com>
1681 Changes done by Darin, reviewed by Kevin.
1683 - changed testkjs to build in Xcode rather than from Makefile
1685 * .cvsignore: Removed obsolete files from this list.
1686 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1687 Changed to build target "All" rather than default target. This makes us
1688 build the testkjs test tool.
1689 * dummy.cpp: Removed.
1690 * kjs/.cvsignore: Removed obsolete files from this list, including
1691 the testkjs tool, which is now built in the symroots directory.
1692 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1693 changed this file. Also this has the nice side effect of causing the tool
1694 to be rebuilt in the new location even if there are no other changes in
1695 your tree when you check this out.
1696 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1697 without setting the execute bit on jsDriver.pl.
1699 2004-07-22 Kevin Decker <kdecker@apple.com>
1703 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1705 * kjs/function_object.cpp:
1706 (FunctionObjectImp::construct):
1707 * kjs/function_object.h:
1709 (KJS::ObjectImp::construct):
1711 (KJS::Object::construct):
1713 2004-07-21 Darin Adler <darin@apple.com>
1715 * bindings/npruntime.h: Fixed typo.
1717 2004-07-19 John Sullivan <sullivan@apple.com>
1721 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1722 vulnerability in my patch for 3714644
1724 * kjs/array_object.cpp:
1725 (ArrayProtoFuncImp::call):
1726 handle NAN parameters passed to slice() by clamping to 0 and length.
1728 2004-07-19 Richard Williamson <rjw@apple.com>
1730 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1735 * bindings/jni/jni_jsobject.cpp:
1737 (JSObject::JSObject):
1739 2004-07-16 John Sullivan <sullivan@apple.com>
1743 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1744 hangs browser with javascript
1746 * kjs/array_object.cpp:
1747 (ArrayProtoFuncImp::call):
1748 Check for undefined type for args[0] the same way we were already checking
1749 for args[1]. In this case, args was zero-length, but we were treating
1750 args[0] like an integer anyway. Resulted in some code looping from a NAN
1751 value to 4, taking approximately forever.
1753 * JavaScriptCore.pbproj/project.pbxproj:
1758 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1762 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1763 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1765 * kjs/number_object.cpp:
1766 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1768 2004-07-13 Kevin Decker <kdecker@apple.com>
1770 Reviewed by kocienda.
1772 - made testkjs and JavaScriptCore a subtarget of 'All'
1773 - testkjs now builds in $SYMROOTS
1775 * JavaScriptCore.pbproj/project.pbxproj:
1779 2004-06-24 Chris Blumenberg <cblu@apple.com>
1781 Ignore .mode1 files in JavaScriptCore.pbproj
1783 Reviewed by kocienda.
1785 * JavaScriptCore.pbproj/.cvsignore:
1787 2004-06-23 Richard Williamson <rjw@apple.com>
1789 Implemented changes for latest npruntime.h.
1793 * JavaScriptCore.pbproj/project.pbxproj:
1794 * bindings/NP_jsobject.cpp:
1795 (listFromVariantArgs):
1796 (identiferFromNPIdentifier):
1797 (_NPN_CreateScriptObject):
1802 (NPN_RemoveProperty):
1803 * bindings/NP_jsobject.h:
1804 * bindings/c/c_class.cpp:
1805 (CClass::methodsNamed):
1806 (CClass::fieldNamed):
1807 * bindings/c/c_instance.cpp:
1808 (CInstance::invokeMethod):
1809 * bindings/c/c_utility.cpp:
1810 (convertNPVariantToValue):
1811 * bindings/c/c_utility.h:
1812 * bindings/npruntime.cpp:
1813 (stringIdentifierEqual):
1814 (stringIdentifierHash):
1815 (getStringIdentifierDictionary):
1816 (intIdentifierEqual):
1817 (intIdentifierHash):
1818 (getIntIdentifierDictionary):
1819 (NPN_GetStringIdentifier):
1820 (NPN_GetStringIdentifiers):
1821 (NPN_GetIntIdentifier):
1822 (NPN_IdentifierIsString):
1823 (NPN_UTF8FromIdentifier):
1824 (NPN_VariantToInt32):
1825 (NPN_VariantToDouble):
1827 * bindings/npruntime.h:
1828 * bindings/objc/WebScriptObject.mm:
1829 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1830 * bindings/runtime_object.cpp:
1831 (RuntimeObjectImp::~RuntimeObjectImp):
1832 * bindings/runtime_root.cpp:
1833 (KJS::Bindings::rootForInterpreter):
1834 * bindings/testbindings.cpp:
1835 (initializeIdentifiers):
1841 === JavaScriptCore-146.1 ===
1843 2004-06-16 Richard Williamson <rjw@apple.com>
1845 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1847 This turned out to be a show stopper for Dashboard. Accessing a nil
1848 ObjC property from JS caused a crash. Similar to the problem
1849 3696112 fixed below.
1853 * bindings/objc/objc_runtime.mm:
1854 (KJS::Bindings::ObjcField::valueFromInstance):
1858 2004-06-16 Richard Williamson <rjw@apple.com>
1860 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1862 This turned out to be a show stopper for Dashboard. We now
1863 return Undefined() when nil is returned from a ObjC method
1864 that returns an object type.
1868 * bindings/objc/objc_utility.mm:
1869 (KJS::Bindings::convertObjcValueToValue):
1873 2004-06-15 Richard Williamson <rjw@apple.com>
1875 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1877 No longer need to check respondsToSelector: for
1878 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1879 because these now have a default implementation on NSObject.
1883 * bindings/objc/objc_class.mm:
1884 (ObjcClass::methodsNamed):
1885 (ObjcClass::fieldNamed):
1887 2004-06-14 Darin Adler <darin@apple.com>
1891 - fixed some things for GC that Patrick missed, or that happened after the branch
1893 * bindings/objc/WebScriptObject.mm:
1894 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1895 (-[WebScriptObject finalize]): Added.
1897 - added some missing nil checks
1899 * bindings/objc/objc_instance.mm:
1900 (ObjcInstance::ObjcInstance): Check for nil.
1901 (ObjcInstance::~ObjcInstance): Check for nil.
1902 (ObjcInstance::operator=): Check for nil.
1904 2004-06-14 Darin Adler <darin@apple.com>
1906 Reviewed by me, code changes by Patrick Beard.
1908 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1910 * bindings/objc/objc_instance.mm:
1911 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1912 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1913 (ObjcInstance::operator=): More of the same.
1914 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1916 * bindings/objc/objc_runtime.mm:
1917 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1918 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1919 (ObjcArray::operator=): More of the same.
1921 * bindings/testbindings.mm: Fixed incorrect license.
1922 (main): Use [pool drain] if compiling on Tiger.
1926 2004-06-10 Kevin Decker <kdecker@apple.com>
1932 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1934 (KJS::Lexer::lineNo):
1935 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1937 === JavaScriptCore-143.2 ===
1939 2004-06-07 Darin Adler <darin@apple.com>
1941 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1943 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1944 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1946 === JavaScriptCore-143.1 ===
1948 2004-06-04 Kevin Decker <kdecker@apple.com>
1952 - fixed <rdar://problem/3680594>
1955 (KJS::Error::create):
1959 2004-06-04 Darin Adler <darin@apple.com>
1961 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1963 2004-06-04 Kevin Decker <kdecker@apple.com>
1967 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1968 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1969 - changed the wording of an error message
1970 - the lexer, parser, and interpreter have been made "sourceURL aware"
1971 - stored the url into Error
1973 * bindings/NP_jsobject.cpp:
1975 * bindings/jni/jni_jsobject.cpp:
1977 * bindings/objc/WebScriptObject.mm:
1978 (-[WebScriptObject evaluateWebScript:]):
1980 (GlobalFuncImp::call):
1981 * kjs/function_object.cpp:
1982 (FunctionObjectImp::construct):
1985 (InterpreterImp::checkSyntax):
1986 (InterpreterImp::evaluate):
1988 * kjs/interpreter.cpp:
1989 (Interpreter::evaluate):
1990 * kjs/interpreter.h:
1994 (KJS::Lexer::sourceURL):
1998 (FunctionCallNode::evaluate):
2001 (KJS::Error::create):
2004 2004-06-04 Richard Williamson <rjw@apple.com>
2006 Fixed crash when attempting to access properties on nil
2011 * bindings/objc/objc_instance.mm:
2012 (ObjcInstance::getClass):
2013 * bindings/runtime_object.cpp:
2014 (RuntimeObjectImp::get):
2015 * bindings/testM.js:
2016 * bindings/testbindings.mm:
2017 (-[MyFirstInterface getString]):
2019 2004-05-27 Kevin Decker <kdecker@apple.com>
2023 -revised generated error message content
2025 * kjs/error_object.cpp:
2026 (ErrorProtoFuncImp::call):
2030 (KJS::Error::create):
2034 2004-05-27 Richard Williamson <rjw@apple.com>
2036 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2040 * bindings/objc/WebScriptObject.h:
2042 2004-05-27 Darin Adler <darin@apple.com>
2046 - moved to new symlink technique for embedding frameworks
2048 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2049 because we don't need it any more.
2051 2004-05-24 Richard Williamson <rjw@apple.com>
2053 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2054 fixed ClassInfo to correctly reflect inheritance. This is required
2055 because of the runtime checks in JSC for arrays, i.e. in
2056 the Function objects apply method.
2060 * bindings/jni/jni_runtime.cpp:
2061 (JavaArray::convertJObjectToArray):
2062 * bindings/objc/objc_utility.mm:
2063 (KJS::Bindings::convertObjcValueToValue):
2064 * bindings/runtime_array.cpp:
2065 (RuntimeArrayImp::RuntimeArrayImp):
2066 * bindings/runtime_array.h:
2067 * bindings/testM.js: Added.
2068 * bindings/testbindings.mm:
2069 (+[MyFirstInterface webScriptNameForSelector:]):
2070 (-[MyFirstInterface logMessages:]):
2071 (-[MyFirstInterface logMessage:prefix:]):
2072 (-[MyFirstInterface callJSObject::]):
2074 2004-05-22 Darin Adler <darin@apple.com>
2078 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2080 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2081 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2082 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2083 it hasn't been set explicitly.
2087 2004-05-20 Richard Williamson <rjw@apple.com>
2089 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
2090 can now be referenced like any other WebScriptObject, meaning
2091 you can do JS operations on them.
2093 All added implementation of finalizeForWebScript.
2097 * bindings/objc/WebScriptObject.h:
2098 * bindings/objc/WebScriptObject.mm:
2099 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2100 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2101 (-[WebScriptObject KJS::]):
2102 (-[WebScriptObject dealloc]):
2103 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2104 (-[WebScriptObject evaluateWebScript:]):
2105 (-[WebScriptObject setValue:forKey:]):
2106 (-[WebScriptObject valueForKey:]):
2107 (-[WebScriptObject stringRepresentation]):
2108 * bindings/objc/WebScriptObjectPrivate.h:
2109 * bindings/objc/objc_instance.mm:
2110 (ObjcInstance::~ObjcInstance):
2112 2004-05-19 Richard Williamson <rjw@apple.com>
2114 Removed extraneous tabs that were added (by XCode?).
2116 * bindings/objc/WebScriptObject.h:
2118 2004-05-19 Darin Adler <darin@apple.com>
2120 - fixed headers with licenses mangled by Xcode auto-indenting
2122 * bindings/jni/jni_jsobject.cpp:
2123 * bindings/jni/jni_jsobject.h:
2124 * bindings/runtime_array.h:
2125 * bindings/runtime_root.cpp:
2126 * bindings/runtime_root.h:
2128 2004-05-18 Richard Williamson <rjw@apple.com>
2130 Added exception logging. Also check for exception and
2131 set results as appropriate.
2133 Reviewed by Maciej (partially reviewed).
2135 * bindings/objc/WebScriptObject.mm:
2136 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2137 (-[WebScriptObject evaluateWebScript:]):
2138 (-[WebScriptObject setValue:forKey:]):
2139 (-[WebScriptObject valueForKey:]):
2141 2004-05-18 Richard Williamson <rjw@apple.com>
2143 Finsished implementing support for windowScriptObject.
2144 Had to make WebScriptObjectPrivate.h accessible from
2149 * JavaScriptCore.pbproj/project.pbxproj:
2150 * bindings/objc/WebScriptObjectPrivate.h:
2152 2004-05-18 Richard Williamson <rjw@apple.com>
2154 Use KVC to set/get values instead of directly accessing
2159 * bindings/objc/WebScriptObject.mm:
2160 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2161 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2162 * bindings/objc/objc_runtime.mm:
2163 (ObjcField::valueFromInstance):
2164 (convertValueToObjcObject):
2165 (ObjcField::setValueToInstance):
2167 2004-05-17 Richard Williamson <rjw@apple.com>
2169 Implemented new API for WebScriptObject.
2171 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2172 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
2176 * JavaScriptCore.pbproj/project.pbxproj:
2177 * bindings/c/c_instance.cpp:
2178 (CInstance::invokeMethod):
2179 * bindings/jni/jni_instance.cpp:
2180 (JavaInstance::invokeMethod):
2181 * bindings/jni/jni_jsobject.cpp:
2182 (JSObject::convertValueToJObject):
2183 * bindings/jni/jni_utility.cpp:
2184 (KJS::Bindings::getJNIField):
2185 * bindings/objc/WebScriptObject.mm:
2187 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2188 (-[WebScriptObject KJS::]):
2189 (-[WebScriptObject dealloc]):
2190 (+[WebScriptObject throwException:]):
2192 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2193 (-[WebScriptObject evaluateWebScript:]):
2194 (-[WebScriptObject setValue:forKey:]):
2195 (-[WebScriptObject valueForKey:]):
2196 (-[WebScriptObject stringRepresentation]):
2197 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2198 (+[WebUndefined undefined]):
2199 (-[WebUndefined initWithCoder:]):
2200 (-[WebUndefined encodeWithCoder:]):
2201 (-[WebUndefined copyWithZone:]):
2202 (-[WebUndefined retain]):
2203 (-[WebUndefined release]):
2204 (-[WebUndefined retainCount]):
2205 (-[WebUndefined autorelease]):
2206 (-[WebUndefined dealloc]):
2207 (-[WebUndefined copy]):
2208 (-[WebUndefined replacementObjectForPortCoder:]):
2209 * bindings/objc/WebScriptObjectPrivate.h: Added.
2210 * bindings/objc/objc_class.mm:
2211 (ObjcClass::methodsNamed):
2212 (ObjcClass::fieldNamed):
2213 * bindings/objc/objc_instance.mm:
2214 (ObjcInstance::invokeMethod):
2215 * bindings/objc/objc_jsobject.h:
2216 * bindings/objc/objc_jsobject.mm:
2217 * bindings/objc/objc_runtime.mm:
2218 (ObjcField::valueFromInstance):
2219 * bindings/objc/objc_utility.mm:
2220 (KJS::Bindings::JSMethodNameToObjCMethodName):
2221 (KJS::Bindings::convertValueToObjcValue):
2222 (KJS::Bindings::convertObjcValueToValue):
2223 * bindings/runtime.cpp:
2224 (Instance::setDidExecuteFunction):
2225 (Instance::didExecuteFunction):
2226 (Instance::setValueOfField):
2227 * bindings/runtime.h:
2228 * bindings/testbindings.mm:
2229 (+[MyFirstInterface webScriptNameForSelector:]):
2230 (-[MyFirstInterface callJSObject::]):
2232 2004-05-14 Vicki Murley <vicki@apple.com>
2236 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2238 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2242 2004-05-13 Richard Williamson <rjw@apple.com>
2249 * bindings/objc/WebScriptObject.h:
2251 2004-05-13 Richard Williamson <rjw@apple.com>
2253 Approved API changes. Currently unimplemented.
2258 * JavaScriptCore.pbproj/project.pbxproj:
2259 * bindings/objc/WebScriptObject.h: Added.
2260 * bindings/objc/WebScriptObject.mm: Added.
2261 (+[WebScriptObject throwException:]):
2262 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2263 (-[WebScriptObject evaluateWebScript:]):
2264 (-[WebScriptObject stringRepresentation]):
2265 (+[WebUndefined undefined]):
2266 (-[WebUndefined initWithCoder:]):
2267 (-[WebUndefined encodeWithCoder:]):
2268 (-[WebUndefined copyWithZone:]):
2270 2004-05-07 Vicki Murley <vicki@apple.com>
2274 Turn off GC since it uses ppc only instructions (which breaks
2277 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2281 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2285 - add -funroll-loops=16 compiler option for approx .5% speedup on
2286 HTML iBench and .5-1% speedup on JS iBench.
2288 * JavaScriptCore.pbproj/project.pbxproj:
2290 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2294 Enable full conservative GC mode in addition to test mode. When
2295 conservative GC is enabled, we now get an 11% speed improvement on
2296 the iBench. Also fix some spots I missed before.
2298 Specific noteworth changes:
2300 * kjs/collector.cpp:
2301 (KJS::Collector::markStackObjectsConservatively): Check possible
2302 cell pointers for 8-byte aligment and verify they are not 0.
2304 * kjs/protected_values.cpp:
2305 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2306 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2308 (KJS::gcProtectNullTolerant): ...to here...
2309 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2310 tolerance, and doing the check is expensive.
2312 * kjs/protected_values.cpp:
2313 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2314 that is still very good.
2319 (KJS::ProtectedValue::ProtectedValue):
2320 (KJS::ProtectedValue::~ProtectedValue):
2321 (KJS::ProtectedValue::operator=):
2322 (KJS::ProtectedObject::ProtectedObject):
2323 (KJS::ProtectedObject::~ProtectedObject):
2324 (KJS::ProtectedObject::operator=):
2325 (KJS::ProtectedReference::ProtectedReference):
2326 (KJS::ProtectedReference::~ProtectedReference):
2327 (KJS::ProtectedReference::operator=):
2328 * kjs/protected_values.cpp:
2329 (KJS::ProtectedValues::getProtectCount):
2330 (KJS::ProtectedValues::increaseProtectCount):
2331 (KJS::ProtectedValues::decreaseProtectCount):
2332 (KJS::ProtectedValues::computeHash):
2333 * bindings/runtime_root.cpp:
2334 (KJS::Bindings::addNativeReference):
2335 (KJS::Bindings::removeNativeReference):
2336 (RootObject::removeAllNativeReferences):
2337 * bindings/runtime_root.h:
2338 (KJS::Bindings::RootObject::~RootObject):
2339 (KJS::Bindings::RootObject::setRootObjectImp):
2340 * kjs/collector.cpp:
2341 (KJS::Collector::allocate):
2342 (KJS::Collector::collect):
2345 (NumberImp::create):
2346 (InterpreterImp::globalInit):
2347 (InterpreterImp::globalClear):
2348 (InterpreterImp::mark):
2350 (KJS::List::derefValues):
2351 (KJS::List::refValues):
2352 (KJS::List::append):
2354 (KJS::ObjectImp::setInternalValue):
2355 (KJS::ObjectImp::putDirect):
2360 (KJS::ValueImp::ValueImp):
2361 (KJS::ValueImp::~ValueImp):
2363 (KJS::Value::Value):
2364 (KJS::Value::~Value):
2365 (KJS::Value::operator=):
2367 2004-04-30 Richard Williamson <rjw@apple.com>
2369 Asking an NSInvocation for it's return value when return type
2370 is void throws an exception. Added check for void return types
2371 to avoid this exception.
2375 * bindings/objc/objc_instance.mm:
2376 (ObjcInstance::invokeMethod):
2378 2004-04-29 Richard Williamson <rjw@apple.com>
2380 Fixed several bad problems with the ObjC bindings. In particular, conversion
2381 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2385 * bindings/objc/objc_jsobject.h:
2386 * bindings/objc/objc_jsobject.mm:
2387 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2388 (-[JavaScriptObject KJS::]):
2389 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2390 (-[JavaScriptObject call:arguments:]):
2391 (-[JavaScriptObject evaluate:]):
2392 (-[JavaScriptObject getMember:]):
2393 (-[JavaScriptObject getSlot:]):
2394 * bindings/objc/objc_runtime.mm:
2395 (ObjcField::valueFromInstance):
2396 (ObjcField::setValueToInstance):
2397 * bindings/objc/objc_utility.mm:
2398 (KJS::Bindings::convertValueToObjcValue):
2399 (KJS::Bindings::convertObjcValueToValue):
2400 * bindings/runtime.h:
2401 * bindings/runtime_root.cpp:
2402 (KJS::Bindings::rootForInterpreter):
2403 (KJS::Bindings::addNativeReference):
2404 (KJS::Bindings::removeNativeReference):
2405 * bindings/runtime_root.h:
2406 * bindings/testbindings.mm:
2407 (-[MyFirstInterface logMessage:]):
2408 (-[MyFirstInterface setJSObject:]):
2409 (-[MyFirstInterface callJSObject::]):
2411 2004-04-24 Darin Adler <darin@apple.com>
2415 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2418 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2422 Implementation of conservative GC, based partly on code from
2423 Darin. It's turned off for now, so it shouldn't have any effect on
2426 * JavaScriptCore.pbproj/project.pbxproj:
2427 * kjs/collector.cpp:
2428 (KJS::Collector::markStackObjectsConservatively):
2429 (KJS::Collector::markProtectedObjects):
2430 (KJS::Collector::collect):
2435 * kjs/protected_values.cpp: Added.
2436 (KJS::ProtectedValues::getProtectCount):
2437 (KJS::ProtectedValues::increaseProtectCount):
2438 (KJS::ProtectedValues::insert):
2439 (KJS::ProtectedValues::decreaseProtectCount):
2440 (KJS::ProtectedValues::expand):
2441 (KJS::ProtectedValues::shrink):
2442 (KJS::ProtectedValues::rehash):
2443 (KJS::ProtectedValues::computeHash):
2444 * kjs/protected_values.h: Added.
2446 (ValueImp::useConservativeMark):
2454 2004-04-22 Richard Williamson <rjw@apple.com>
2456 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2459 * bindings/npruntime.h:
2461 2004-04-22 Richard Williamson <rjw@apple.com>
2463 Updated plugin binding API to reflect latest revision from
2466 Biggest change is the introduction of NPVariant used to represent
2467 value types. NPVariant replaces the use of NPObject for the
2468 exchange of values between scripting environment and native code.
2472 * JavaScriptCore.pbproj/project.pbxproj:
2473 * bindings/NP_jsobject.cpp:
2474 (identiferFromNPIdentifier):
2480 (NPN_GetPropertyAtIndex):
2481 (NPN_SetPropertyAtIndex):
2482 * bindings/c/c_class.cpp:
2483 (CClass::methodsNamed):
2484 (CClass::fieldNamed):
2485 * bindings/c/c_instance.cpp:
2486 (CInstance::invokeMethod):
2487 (CInstance::defaultValue):
2488 * bindings/c/c_runtime.cpp:
2489 (CField::valueFromInstance):
2490 (CField::setValueToInstance):
2491 * bindings/c/c_utility.cpp:
2492 (convertNPStringToUTF16):
2493 (convertUTF8ToUTF16):
2494 (coerceValueToNPVariantStringType):
2495 (convertValueToNPVariant):
2496 (convertNPVariantToValue):
2497 * bindings/c/c_utility.h:
2498 * bindings/npruntime.cpp:
2499 (NPN_GetIdentifier):
2500 (NPN_GetIdentifiers):
2501 (NPN_UTF8FromIdentifier):
2502 (NPN_VariantIsVoid):
2503 (NPN_VariantIsNull):
2504 (NPN_VariantIsUndefined):
2505 (NPN_VariantIsBool):
2506 (NPN_VariantIsInt32):
2507 (NPN_VariantIsDouble):
2508 (NPN_VariantIsString):
2509 (NPN_VariantIsObject):
2510 (NPN_VariantToBool):
2511 (NPN_VariantToString):
2512 (NPN_VariantToInt32):
2513 (NPN_VariantToDouble):
2514 (NPN_VariantToObject):
2515 (NPN_InitializeVariantAsVoid):
2516 (NPN_InitializeVariantAsNull):
2517 (NPN_InitializeVariantAsUndefined):
2518 (NPN_InitializeVariantWithBool):
2519 (NPN_InitializeVariantWithInt32):
2520 (NPN_InitializeVariantWithDouble):
2521 (NPN_InitializeVariantWithString):
2522 (NPN_InitializeVariantWithStringCopy):
2523 (NPN_InitializeVariantWithObject):
2524 (NPN_InitializeVariantWithVariant):
2525 (NPN_ReleaseVariantValue):
2528 (NPN_ReleaseObject):
2529 (NPN_IsKindOfClass):
2530 (NPN_SetExceptionWithUTF8):
2532 * bindings/npruntime.h:
2534 (_NPString::_NPVariant::):
2535 * bindings/testbindings.cpp:
2550 2004-04-22 Darin Adler <darin@apple.com>
2554 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2557 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2558 Was resulting in a buffer 2x the needed size.
2559 (KJS::UString::expandPreCapacity): Ditto.
2560 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2562 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2566 Preliminary change for conservative GC. Create "protected"
2567 subclasses to GC-protect objects when on heap, since we will soon
2568 remove the built-in refcounting of the normal wrapper classes. Use
2571 * JavaScriptCore.pbproj/project.pbxproj:
2574 (KJS::InterpreterImp::globalObject):
2575 * kjs/interpreter.h:
2576 * kjs/property_map.cpp:
2578 * kjs/reference_list.cpp:
2580 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2584 Optimize prepend using the shared substring optimization. Also,
2585 limit the applicability of shared append and shared prepend. If
2586 you overdo it, it does more harm than good, because you create a
2587 bunch of strings that are disqualified from future shared
2588 append/prepend, for not much immediate savings in allocate/copy
2593 (KJS::UString::Rep::create):
2594 (KJS::UString::expandedSize):
2595 (KJS::UString::usedPreCapacity):
2596 (KJS::UString::expandCapacity):
2597 (KJS::UString::expandPreCapacity):
2598 (KJS::UString::UString):
2599 (KJS::UString::append):
2600 (KJS::UString::operator=):
2602 (KJS::UString::Rep::data):
2604 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2605 Reviewed by Richard.
2607 No more need for Completion or Reference to privately inherit from
2608 Value, none of the superclass functionality is used.
2615 2004-04-16 Richard Williamson <rjw@apple.com>
2617 Added interpreter lock protection around object creation.
2621 * bindings/runtime.cpp:
2622 (Instance::createRuntimeObject):
2624 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2628 Another JavaScript speed improvement: use the mechanism from
2629 string append optimization to make taking a substring fast, again
2632 A further 22% improvement on the 24fun string speed test.
2636 (KJS::UString::Rep::create):
2637 (KJS::UString::UString):
2638 (KJS::UString::append):
2639 (KJS::UString::operator=):
2640 (KJS::UString::substr):
2642 (KJS::UString::Rep::data):
2644 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2648 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2649 - fixed <rdar://problem/3600691>: Table generation test is really slow
2650 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2652 80% speedup on the string test, lesser speedups on the other two.
2654 Two different optimizations here:
2656 1) Avoid large overhead of scanning strings to see if they are all
2657 ASCII before numeric conversion.
2660 (AssignNode::evaluate): Don't convert to integer until we know for
2661 sure the operation will need it. Attempting to convert strings to
2662 numbers is a waste when they are being appended with +=.
2664 2) Avoid huge cost of appending strings.
2666 This is done by allowing multiple strings to share a buffer but
2667 actually use different ranges of it. The first time a string is
2668 appended to, we start leaving at least 10% extra space in the
2669 buffer, so doing N appends to the same string takes O(log N)
2670 mallocs instead of O(N).
2672 * kjs/identifier.cpp:
2673 (KJS::Identifier::equal):
2674 (KJS::Identifier::add):
2677 (KJS::UCharReference::operator=):
2678 (KJS::UCharReference::ref):
2679 (KJS::UString::Rep::create):
2680 (KJS::UString::Rep::destroy):
2681 (KJS::UString::expandedSize):
2682 (KJS::UString::usedCapacity):
2683 (KJS::UString::expandCapacity):
2684 (KJS::UString::UString):
2685 (KJS::UString::null):
2686 (KJS::UString::append):
2687 (KJS::UString::operator=):
2688 (KJS::UString::toStrictUInt32):
2689 (KJS::UString::detach):
2690 (KJS::KJS::operator==):
2692 (KJS::UString::Rep::data):
2693 (KJS::UString::Rep::hash):
2695 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2699 - fix deployment build by avoiding deployment-only warning.
2701 * kjs/scope_chain.cpp:
2702 (KJS::ScopeChain::bottom):
2704 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2708 Changed things so that newly created objects get a prototype based
2709 on the scope chain of the current function, rather than the
2710 interpreter that started execution. This fixes the following bugs:
2712 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2713 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2715 * JavaScriptCore.pbproj/project.pbxproj:
2716 * kjs/array_object.cpp:
2717 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2718 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2719 (ArrayProtoFuncImp::call):
2720 (ArrayObjectImp::construct):
2721 * kjs/bool_object.cpp:
2722 (BooleanObjectImp::construct):
2723 * kjs/date_object.cpp:
2724 (DateProtoFuncImp::DateProtoFuncImp):
2725 (DateProtoFuncImp::call):
2726 (DateObjectImp::construct):
2727 * kjs/error_object.cpp:
2728 (ErrorObjectImp::construct):
2730 (FunctionImp::FunctionImp):
2731 (FunctionImp::call):
2732 (DeclaredFunctionImp::construct):
2733 (ArgumentsImp::ArgumentsImp):
2734 (GlobalFuncImp::call):
2735 * kjs/function_object.cpp:
2736 (FunctionProtoFuncImp::call):
2737 (FunctionObjectImp::construct):
2739 (BooleanImp::toObject):
2740 (StringImp::toObject):
2741 (NumberImp::toObject):
2742 (InterpreterImp::InterpreterImp):
2743 (InterpreterImp::clear):
2744 (InterpreterImp::interpreterWithGlobalObject):
2746 * kjs/interpreter.cpp:
2747 (ExecState::lexicalInterpreter):
2748 * kjs/interpreter.h:
2749 (KJS::ExecState::dynamicInterpreter):
2750 (KJS::ExecState::interpreter):
2751 * kjs/math_object.cpp:
2752 (MathFuncImp::MathFuncImp):
2754 (StatementNode::hitStatement):
2755 (StatementNode::abortStatement):
2756 (RegExpNode::evaluate):
2757 (ElementNode::evaluate):
2758 (ArrayNode::evaluate):
2759 (ObjectLiteralNode::evaluate):
2760 (PropertyValueNode::evaluate):
2761 (FunctionCallNode::evaluate):
2762 (FuncDeclNode::processFuncDecl):
2763 (FuncExprNode::evaluate):
2764 * kjs/number_object.cpp:
2765 (NumberObjectImp::construct):
2767 (KJS::ObjectImp::defaultValue):
2768 (KJS::Error::create):
2769 * kjs/object_object.cpp:
2770 (ObjectObjectImp::construct):
2771 * kjs/reference.cpp:
2772 (Reference::putValue):
2773 * kjs/regexp_object.cpp:
2774 (RegExpProtoFuncImp::call):
2775 (RegExpObjectImp::arrayOfMatches):
2776 (RegExpObjectImp::construct):
2777 * kjs/scope_chain.cpp:
2778 (KJS::ScopeChain::bottom):
2779 * kjs/scope_chain.h:
2780 * kjs/string_object.cpp:
2781 (StringProtoFuncImp::StringProtoFuncImp):
2782 (StringProtoFuncImp::call):
2783 (StringObjectImp::construct):
2789 2004-03-31 Richard Williamson <rjw@apple.com>
2791 Tedious renames based on feedback from plugin-futures list.
2792 NP_ functions are renamed with NPN_ prefix.
2793 Types prefix renamed from NP_ to NP.
2794 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2796 No review because this was just a renaming patch.
2798 * bindings/NP_jsobject.cpp:
2801 (identiferFromNPIdentifier):
2806 (NPN_RemoveProperty):
2808 (NPN_GetPropertyAtIndex):
2809 (NPN_SetPropertyAtIndex):
2810 * bindings/NP_jsobject.h:
2811 * bindings/c/c_class.cpp:
2812 (CClass::_commonInit):
2813 (CClass::classForIsA):
2815 (CClass::methodsNamed):
2816 (CClass::fieldNamed):
2817 * bindings/c/c_class.h:
2818 * bindings/c/c_instance.cpp:
2819 (CInstance::CInstance):
2820 (CInstance::~CInstance):
2821 (CInstance::operator=):
2822 (CInstance::invokeMethod):
2823 (CInstance::defaultValue):
2824 * bindings/c/c_instance.h:
2825 (KJS::Bindings::CInstance::getObject):
2826 * bindings/c/c_runtime.cpp:
2827 (CField::valueFromInstance):
2828 (CField::setValueToInstance):
2829 * bindings/c/c_runtime.h:
2830 (KJS::Bindings::CField::CField):
2831 (KJS::Bindings::CField::name):
2832 (KJS::Bindings::CMethod::CMethod):
2833 (KJS::Bindings::CMethod::name):
2834 * bindings/c/c_utility.cpp:
2835 (coerceValueToNPString):
2836 (convertValueToNPValueType):
2837 (convertNPValueTypeToValue):
2838 * bindings/c/c_utility.h:
2839 * bindings/npruntime.cpp:
2840 (NPN_IdentifierFromUTF8):
2841 (NPN_IsValidIdentifier):
2842 (NPN_GetIdentifiers):
2843 (NPN_UTF8FromIdentifier):
2846 (NPN_ReleaseObject):
2847 (NPN_IsKindOfClass):
2848 (NPN_SetExceptionWithUTF8):
2851 (NPN_CreateNumberWithInt):
2852 (NPN_CreateNumberWithFloat):
2853 (NPN_CreateNumberWithDouble):
2854 (NPN_IntFromNumber):
2855 (NPN_FloatFromNumber):
2856 (NPN_DoubleFromNumber):
2858 (NPN_CreateStringWithUTF8):
2859 (NPN_CreateStringWithUTF16):
2860 (NPN_DeallocateUTF8):
2861 (NPN_UTF8FromString):
2862 (NPN_UTF16FromString):
2865 (NPN_CreateBoolean):
2866 (NPN_BoolFromBoolean):
2869 (undefinedAllocate):
2875 (NPN_ObjectAtIndex):
2876 * bindings/npruntime.h:
2877 * bindings/runtime.cpp:
2878 (Instance::createBindingForLanguageInstance):
2879 * bindings/testbindings.cpp:
2880 (initializeIdentifiers):
2900 2004-03-31 Richard Williamson <rjw@apple.com>
2902 Changed references to NP_runtime.h to npruntime.h
2904 * JavaScriptCore.pbproj/project.pbxproj:
2905 * bindings/NP_jsobject.h:
2906 * bindings/c/c_class.h:
2907 * bindings/c/c_instance.h:
2908 * bindings/c/c_runtime.h:
2909 * bindings/c/c_utility.h:
2910 * bindings/npruntime.cpp:
2912 2004-03-31 Richard Williamson <rjw@apple.com>
2914 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2916 * JavaScriptCore.pbproj/project.pbxproj:
2917 * bindings/NP_jsobject.h:
2918 * bindings/npruntime.cpp:
2922 2004-03-23 Richard Williamson <rjw@apple.com>
2924 Added implementation of KJS::Value <-> NP_Object conversion functions.
2925 Augmented test program for 'C' bindings.
2926 Added asserts and parameter checking to all public API.
2930 * JavaScriptCore.pbproj/project.pbxproj:
2931 * bindings/NP_jsobject.cpp:
2933 * bindings/NP_jsobject.h: Added.
2934 * bindings/NP_runtime.cpp:
2935 (NP_IdentifierFromUTF8):
2936 (NP_IsValidIdentifier):
2937 (NP_GetIdentifiers):
2942 (NP_SetExceptionWithUTF8):
2945 (NP_FloatFromNumber):
2946 (NP_DoubleFromNumber):
2947 (NP_CreateStringWithUTF8):
2948 (NP_CreateStringWithUTF16):
2949 (NP_DeallocateUTF8):
2950 (NP_UTF8FromString):
2951 (NP_UTF16FromString):
2953 (NP_BoolFromBoolean):
2954 * bindings/NP_runtime.h:
2955 * bindings/c/c_instance.cpp:
2956 (CInstance::invokeMethod):
2957 * bindings/c/c_utility.cpp:
2958 (coerceValueToNPString):
2959 (convertValueToNPValueType):
2960 (convertNPValueTypeToValue):
2961 * bindings/c/c_utility.h:
2963 * bindings/testC.js: Added.
2964 * bindings/testbindings.cpp:
2974 (myInterfaceInvoke):
2975 (myInterfaceAllocate):
2979 2004-03-19 Darin Adler <darin@apple.com>
2983 - fixed problem with methods like setUTCHour
2985 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2986 GMT vs. local time function based on the utc flag.
2988 2004-03-17 Richard Williamson <rjw@apple.com>
2990 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2994 * bindings/NP_jsobject.cpp:
2999 (NP_GetPropertyAtIndex):
3000 * bindings/NP_runtime.h:
3002 2004-03-16 Richard Williamson <rjw@apple.com>
3004 Fixed 3590169. Regression (crash) caused by the switch to MethodLists. Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
3008 * bindings/jni/jni_class.cpp:
3009 (JavaClass::methodsNamed):
3011 2004-03-15 Richard Williamson <rjw@apple.com>
3013 Fixed 3570854. Don't attempt to convert Null to strings. We
3014 were incorrectly converting to "Null".
3016 Actually fixed by Scott Kovatch.
3018 Reviewed by Richard.
3020 * bindings/jni/jni_utility.cpp:
3021 (KJS::Bindings::convertValueToJValue):
3025 2004-03-11 Richard Williamson <rjw@apple.com>
3027 Stitched together the NP stuff to our language independent
3028 JavaScript binding stuff. Very close to being done.
3030 Added program to test C bindings (and NP stuff). Just tests
3031 properties. Will add methods and JavaScript access, etc.
3033 Updated Makefile.am to account for new bindings/c directory.
3035 Change NP_UTF8 from "const char *" to "char" to allow for
3036 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
3039 Added NP_IsValidIdentifier().
3043 * JavaScriptCore.pbproj/project.pbxproj:
3045 * bindings/NP_jsobject.cpp:
3046 (identiferFromNPIdentifier):
3048 * bindings/NP_runtime.cpp:
3049 (NP_IdentifierFromUTF8):
3050 (NP_IsValidIdentifier):
3051 (NP_GetIdentifiers):
3052 (NP_UTF8FromIdentifier):
3053 (NP_SetExceptionWithUTF8):
3055 (NP_CreateStringWithUTF8):
3056 (NP_CreateStringWithUTF16):
3057 (NP_UTF8FromString):
3058 (NP_UTF16FromString):
3059 * bindings/NP_runtime.h:
3060 * bindings/c/c_class.cpp: Added.
3061 (CClass::_commonDelete):
3062 (CClass::_commonCopy):
3063 (CClass::_commonInit):
3064 (_createClassesByIsAIfNecessary):
3065 (CClass::classForIsA):
3068 (CClass::methodsNamed):
3069 (CClass::fieldNamed):
3070 * bindings/c/c_class.h: Added.
3071 (KJS::Bindings::CClass::~CClass):
3072 (KJS::Bindings::CClass::CClass):
3073 (KJS::Bindings::CClass::operator=):
3074 (KJS::Bindings::CClass::constructorAt):
3075 (KJS::Bindings::CClass::numConstructors):
3076 * bindings/c/c_instance.cpp: Added.
3077 (CInstance::CInstance):
3078 (CInstance::~CInstance):
3079 (CInstance::operator=):
3080 (CInstance::getClass):
3083 (CInstance::invokeMethod):
3084 (CInstance::defaultValue):
3085 (CInstance::stringValue):
3086 (CInstance::numberValue):
3087 (CInstance::booleanValue):
3088 (CInstance::valueOf):
3089 * bindings/c/c_instance.h: Added.
3090 (KJS::Bindings::CInstance::getObject):
3091 * bindings/c/c_runtime.cpp: Added.
3092 (CField::valueFromInstance):
3093 (CField::setValueToInstance):
3094 * bindings/c/c_runtime.h: Added.
3095 (KJS::Bindings::CField::CField):
3096 (KJS::Bindings::CField::name):
3097 (KJS::Bindings::CField::type):
3098 (KJS::Bindings::CMethod::CMethod):
3099 (KJS::Bindings::CMethod::name):
3100 (KJS::Bindings::CMethod::numParameters):
3101 * bindings/c/c_utility.cpp: Added.
3102 (coerceValueToNPValueType):
3103 (convertValueToNPValueType):
3104 (convertNPValueTypeToValue):
3105 * bindings/c/c_utility.h: Added.
3106 * bindings/make_testbindings:
3107 * bindings/runtime.cpp:
3108 (Instance::createBindingForLanguageInstance):
3109 * bindings/runtime.h:
3110 (KJS::Bindings::Instance::):
3111 * bindings/testbindings.cpp: Added.
3112 (initializeIdentifiers):
3113 (myInterfaceHasProperty):
3114 (myInterfaceHasMethod):
3115 (myInterfaceGetProperty):
3116 (myInterfaceSetProperty):
3117 (myInterfaceInvoke):
3118 (myInterfaceAllocate):
3119 (myInterfaceInvalidate):
3120 (myInterfaceDeallocate):
3121 (GlobalImp::className):
3122 (readJavaScriptFromFile):
3125 2004-03-10 Richard Williamson <rjw@apple.com>
3127 Made changes to support new asychronous approach to calls from
3128 plugin to JavaScript
3132 * bindings/NP_jsobject.cpp:
3137 (NP_GetPropertyAtIndex):
3138 * bindings/NP_runtime.h:
3139 * bindings/make_testbindings:
3140 * bindings/runtime.cpp:
3141 (Instance::createBindingForLanguageInstance):
3143 2004-03-10 Richard Williamson <rjw@apple.com>
3145 Updated header to include proposed changes from
3146 plugin-futures list. Calls from plugin to JavaScript
3147 are now asynchronous.
3151 * bindings/NP_runtime.h:
3155 2004-03-04 Richard Williamson <rjw@apple.com>
3157 Implementation of NP_JavaScriptObject. This is the 'C' class
3158 that wraps a JavaScript object.
3162 * JavaScriptCore.pbproj/project.pbxproj:
3163 * bindings/NP_jsobject.cpp: Added.
3164 (coerceValueToNPValueType):
3165 (convertValueToNPValueType):
3166 (convertNPValueTypeToValue):
3170 (identiferFromNPIdentifier):
3175 (NP_RemoveProperty):
3177 (NP_GetPropertyAtIndex):
3178 (NP_SetPropertyAtIndex):
3179 * bindings/NP_runtime.cpp:
3181 * bindings/NP_runtime.h:
3182 * bindings/runtime_object.h:
3184 2004-03-04 Richard Williamson <rjw@apple.com>
3186 Added NP_Array implementation.
3188 Changed NP_Boolean to just depend on two static instances, no
3189 space is required for values.
3193 * bindings/NP_runtime.cpp:
3195 (NP_BoolFromBoolean):
3201 * bindings/NP_runtime.h:
3203 2004-03-03 Darin Adler <darin@apple.com>
3207 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3208 copyright string, and that's all that was in here.
3209 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3211 2004-03-03 Richard Williamson <rjw@apple.com>
3213 More 'C' binding implementation. Fleshed out all the
3214 'primitive' data types.
3218 * bindings/NP_runtime.cpp:
3223 (NP_CreateStringWithUTF8):
3224 (NP_CreateStringWithUTF16):
3225 (NP_UTF8FromString):
3226 (NP_UTF16FromString):
3229 (booleanDeallocate):
3231 (NP_BoolFromBoolean):
3235 (undefinedAllocate):
3236 (undefinedDeallocate):
3238 * bindings/NP_runtime.h:
3240 2004-03-03 Richard Williamson <rjw@apple.com>
3242 More 'C' binding implementation.
3246 * bindings/NP_runtime.cpp:
3249 (getIdentifierDictionary):
3250 (NP_IdentifierFromUTF8):
3251 (NP_UTF8FromIdentifier):
3256 (NP_CreateNumberWithInt):
3257 (NP_CreateNumberWithFloat):
3258 (NP_CreateNumberWithDouble):
3260 (NP_FloatFromNumber):
3261 (NP_DoubleFromNumber):
3262 * bindings/NP_runtime.h:
3264 2004-03-02 Richard Williamson <rjw@apple.com>
3266 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3267 own customer retain/release scheme.
3271 * bindings/NP_runtime.cpp:
3274 * bindings/NP_runtime.h:
3276 2004-03-02 Richard Williamson <rjw@apple.com>
3278 C binding API. Partial implementation.
3280 Completed ObjectiveC bindings (not based on the C API). These will re-implemented over the C binding API, but I wanted to get this code in the tree.
3282 Factored root object reference counting scheme. It is now useful independent
3287 * JavaScriptCore.pbproj/project.pbxproj:
3288 * bindings/NP_runtime.cpp: Added.
3289 (NP_IdentifierFromUTF8):
3290 (NP_GetIdentifiers):
3291 (NP_UTF8FromIdentifier):
3301 (NP_RemoveProperty):
3303 (NP_GetPropertyAtIndex):
3304 (NP_SetPropertyAtIndex):
3305 (NP_CreateNumberWithInt):
3306 (NP_CreateNumberWithFloat):
3307 (NP_CreateNumberWithDouble):
3309 (NP_FloatFromNumber):
3310 (NP_DoubleFromNumber):
3311 (NP_CreateStringWithUTF8):
3312 (NP_CreateStringWithUTF16):
3313 (NP_UTF8FromString):
3314 (NP_UTF16FromString):
3316 (NP_BoolFromBoolean):
3322 * bindings/NP_runtime.h: Added.
3323 * bindings/jni/jni_jsobject.cpp:
3325 (JSObject::finalize):
3326 (JSObject::createNative):
3327 (JSObject::convertValueToJObject):
3328 * bindings/jni/jni_jsobject.h:
3329 * bindings/objc/objc_jsobject.h:
3330 * bindings/objc/objc_jsobject.mm:
3332 (windowJavaScriptObject):
3333 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3334 (-[JavaScriptObject dealloc]):
3335 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3336 (-[JavaScriptObject call:arguments:]):
3337 (-[JavaScriptObject evaluate:]):
3338 (-[JavaScriptObject getMember:]):
3339 (-[JavaScriptObject setMember:value:]):
3340 (-[JavaScriptObject removeMember:]):
3341 (-[JavaScriptObject toString]):
3342 (-[JavaScriptObject getSlot:]):
3343 (-[JavaScriptObject setSlot:value:]):
3344 * bindings/objc/objc_utility.h:
3345 * bindings/objc/objc_utility.mm:
3346 (KJS::Bindings::convertValueToObjcValue):
3347 * bindings/runtime_root.cpp: Added.
3348 (getReferencesByRootDictionary):
3349 (getReferencesDictionary):
3350 (KJS::Bindings::findReferenceDictionary):
3351 (KJS::Bindings::rootForImp):
3352 (KJS::Bindings::addNativeReference):
3353 (KJS::Bindings::removeNativeReference):
3354 (completedJavaScriptAccess):
3355 (initializeJavaScriptAccessLock):
3356 (lockJavaScriptAccess):
3357 (unlockJavaScriptAccess):
3358 (RootObject::dispatchToJavaScriptThread):
3359 (performJavaScriptAccess):
3360 (RootObject::setFindRootObjectForNativeHandleFunction):
3361 (RootObject::removeAllNativeReferences):
3362 * bindings/runtime_root.h: Added.
3363 (KJS::Bindings::RootObject::RootObject):
3364 (KJS::Bindings::RootObject::~RootObject):
3365 (KJS::Bindings::RootObject::setRootObjectImp):
3366 (KJS::Bindings::RootObject::rootObjectImp):
3367 (KJS::Bindings::RootObject::setInterpreter):
3368 (KJS::Bindings::RootObject::interpreter):
3369 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3370 (KJS::Bindings::RootObject::runLoop):
3371 (KJS::Bindings::RootObject::performJavaScriptSource):
3377 2004-02-18 Richard Williamson <rjw@apple.com>
3379 Added NSNumber/Number conversion.
3381 Removed some unnecessary KJS:: namespace specifiers.
3385 * bindings/objc/objc_utility.mm:
3386 (KJS::Bindings::convertValueToObjcValue):
3387 (KJS::Bindings::convertObjcValueToValue):
3388 * bindings/runtime_array.h:
3390 2004-02-18 Richard Williamson <rjw@apple.com>
3392 Added support for export NSArrays.
3394 Updated valueAt() to take an ExecState so we can throw
3397 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
3398 ObjectiveC classes to control the visibility of their methods in
3403 * bindings/jni/jni_runtime.cpp:
3404 (JavaField::valueFromInstance):
3405 (JavaArray::valueAt):
3406 * bindings/jni/jni_runtime.h:
3407 * bindings/objc/objc_class.mm:
3408 (ObjcClass::methodsNamed):
3409 * bindings/objc/objc_runtime.h:
3410 (KJS::Bindings::ObjcArray::getObjcArray):
3411 * bindings/objc/objc_runtime.mm:
3412 (ObjcField::valueFromInstance):
3413 (ObjcField::setValueToInstance):
3414 (ObjcArray::ObjcArray):
3415 (ObjcArray::~ObjcArray):
3416 (ObjcArray::operator=):
3417 (ObjcArray::setValueAt):
3418 (ObjcArray::valueAt):
3419 (ObjcArray::getLength):
3420 * bindings/objc/objc_utility.mm:
3421 (KJS::Bindings::convertValueToObjcValue):
3422 (KJS::Bindings::convertObjcValueToValue):
3423 * bindings/runtime.cpp:
3424 (Instance::getValueOfField):
3425 * bindings/runtime.h:
3426 * bindings/runtime_array.cpp:
3427 (RuntimeArrayImp::get):
3428 * bindings/runtime_object.cpp:
3429 (RuntimeObjectImp::get):
3431 2004-02-17 Richard Williamson <rjw@apple.com>
3433 Added String <-> NSString conversion.
3434 Added tests of String <-> NSString conversion to test program.
3438 * bindings/objc/objc_utility.mm:
3439 (KJS::Bindings::convertValueToObjcValue):
3440 (KJS::Bindings::convertObjcValueToValue):
3442 * bindings/testbindings.mm:
3443 (-[MyFirstInterface getString]):
3445 2004-02-15 Darin Adler <darin@apple.com>
3449 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3450 and removing redundant settings of things that match defaults in other build styles.
3452 2004-02-13 Richard Williamson <rjw@apple.com>
3454 Work towards the JavaScript ObjC bindings. The bindings now work for
3455 simple scalar types. testbindings.mm is an illustration of how the
3460 * JavaScriptCore.pbproj/project.pbxproj:
3462 * bindings/jni/jni_class.cpp:
3463 (JavaClass::methodsNamed):
3464 * bindings/jni/jni_class.h:
3465 * bindings/jni/jni_instance.cpp:
3466 (JavaInstance::invokeMethod):
3467 * bindings/jni/jni_instance.h:
3468 * bindings/jni/jni_runtime.h:
3469 (KJS::Bindings::JavaMethod::returnType):
3470 * bindings/make_testbindings: Added.
3471 * bindings/objc/objc_class.h: Added.
3472 (KJS::Bindings::ObjcClass::~ObjcClass):
3473 (KJS::Bindings::ObjcClass::ObjcClass):
3474 (KJS::Bindings::ObjcClass::operator=):
3475 (KJS::Bindings::ObjcClass::constructorAt):
3476 (KJS::Bindings::ObjcClass::numConstructors):
3477 * bindings/objc/objc_class.mm: Added.
3478 (ObjcClass::_commonDelete):
3479 (ObjcClass::_commonCopy):
3480 (ObjcClass::_commonInit):
3481 (_createClassesByIsAIfNecessary):
3482 (ObjcClass::classForIsA):
3483 (ObjcClass::ObjcClass):
3485 (ObjcClass::methodsNamed):
3486 (ObjcClass::fieldNamed):
3487 * bindings/objc/objc_header.h: Added.
3488 * bindings/objc/objc_instance.h: Added.
3489 (KJS::Bindings::ObjcInstance::getObject):
3490 * bindings/objc/objc_instance.mm: Added.
3491 (ObjcInstance::ObjcInstance):
3492 (ObjcInstance::~ObjcInstance):
3493 (ObjcInstance::operator=):
3494 (ObjcInstance::begin):
3495 (ObjcInstance::end):
3496 (ObjcInstance::getClass):
3497 (ObjcInstance::invokeMethod):
3498 (ObjcInstance::defaultValue):
3499 (ObjcInstance::stringValue):
3500 (ObjcInstance::numberValue):
3501 (ObjcInstance::booleanValue):
3502 (ObjcInstance::valueOf):
3503 * bindings/objc/objc_jsobject.h: Added.
3504 * bindings/objc/objc_jsobject.mm: Added.
3505 * bindings/objc/objc_runtime.h:
3506 (KJS::Bindings::ObjcField::~ObjcField):
3507 (KJS::Bindings::ObjcField::ObjcField):
3508 (KJS::Bindings::ObjcField::operator=):
3509 (KJS::Bindings::ObjcMethod::ObjcMethod):
3510 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3511 (KJS::Bindings::ObjcMethod::operator=):
3512 * bindings/objc/objc_runtime.mm: Added.
3513 (ObjcMethod::ObjcMethod):
3515 (ObjcMethod::numParameters):
3516 (ObjcMethod::getMethodSignature):
3517 (ObjcField::ObjcField):
3520 (ObjcField::valueFromInstance):
3521 (ObjcField::setValueToInstance):
3522 * bindings/objc/objc_utility.h: Added.
3524 * bindings/objc/objc_utility.mm: Added.
3525 (KJS::Bindings::JSMethodNameToObjCMethodName):
3526 (KJS::Bindings::convertValueToObjcValue):
3527 (KJS::Bindings::convertObjcValueToValue):
3528 (KJS::Bindings::objcValueTypeForType):
3529 * bindings/runtime.cpp:
3530 (MethodList::MethodList):
3531 (MethodList::operator=):
3532 (Instance::setValueOfField):
3533 (Instance::createBindingForLanguageInstance):
3534 (Instance::createRuntimeObject):
3535 * bindings/runtime.h:
3536 * bindings/runtime_method.cpp:
3537 (RuntimeMethodImp::RuntimeMethodImp):
3538 (RuntimeMethodImp::get):
3539 (RuntimeMethodImp::call):
3540 * bindings/runtime_method.h:
3541 * bindings/runtime_object.cpp:
3542 (RuntimeObjectImp::get):
3543 (RuntimeObjectImp::hasProperty):
3544 * bindings/test.js: Added.
3545 * bindings/testbindings.mm: Added.
3546 (-[MySecondInterface init]):
3547 (-[MyFirstInterface init]):
3548 (-[MyFirstInterface dealloc]):
3549 (+[MyFirstInterface JavaScriptNameForSelector:]):
3550 (-[MyFirstInterface getInt]):
3551 (-[MyFirstInterface setInt:]):
3552 (-[MyFirstInterface getMySecondInterface]):
3553 (-[MyFirstInterface logMessage:]):
3554 (GlobalImp::className):
3555 (readJavaScriptFromFile):
3560 2004-02-08 Darin Adler <darin@apple.com>
3564 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3566 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3567 macros from working right in C++ code that uses the <cctype> header.
3570 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3571 (KJS::UTF8SequenceLengthNonASCII): Added.
3572 (KJS::inlineUTF8SequenceLength): Added.
3573 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3574 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3575 (KJS::createSortedOffsetsArray): Add special