1 2005-04-22 Darin Adler <darin@apple.com>
5 * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
7 2005-04-22 Darin Adler <darin@apple.com>
11 - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
13 * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
14 Not sure why we missed this one earlier.
16 * kjs/grammar.cpp: Regenerated.
18 === JavaScriptCore-412.1 ===
20 2005-04-20 Darin Adler <darin@apple.com>
24 - speedups, total 12% on JavaScript iBench
26 I ran the benchmark under Shark and followed its advice a lot, mainly.
29 (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
30 Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
31 have to bump it each time we call allocate. Put numLiveObjects into a local variable to
32 cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
33 than a pointer so we don't need a special case for NULL. Allow freeList to point to some
34 bogus item when the entire block is full rather than going out of our way to make it
36 (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
37 the loop to avoid re-loading them over and over again.
38 (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
39 variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
40 into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
41 rather than numAllocationsSinceLastCollect.
42 (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
43 the loop to avoid re-loading them over and over again.
44 (KJS::Collector::rootObjectClasses): Ditto.
46 * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
47 directly, avoiding the conversion from Number to Value.
49 * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
50 the thing is an object and we don't want to do all the extra work; just cast directly.
52 * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
53 a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
55 * kjs/lookup.cpp: (keysMatch): Marked this inline.
57 * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
58 (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
60 (NumberNode::evaluate): Ditto.
61 (StringNode::evaluate): Ditto.
62 (ArrayNode::evaluate): Ditto.
63 (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
64 Also just use a pointer for func, rather than an Object.
65 (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
66 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
68 (DeleteNode::evaluate): Make a Value directly.
69 (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
70 (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
71 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
73 (UnaryPlusNode::evaluate): Make a Value directly.
74 (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
75 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
77 (BitwiseNotNode::evaluate): Make a Value directly.
78 (LogicalNotNode::evaluate): Ditto.
79 (ShiftNode::evaluate): Don't convert to a double before making a Value.
80 (RelationalNode::evaluate): Make a Value directly.
81 (EqualNode::evaluate): Ditto.
82 (BitOperNode::evaluate): Ditto.
83 (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
84 boolean in, often avoiding a conversion from floating point to integer and back.
85 (VarDeclNode::evaluate): Make a Value directly.
86 (ForNode::execute): Remove unused local variable.
89 (KJS::isNaN): Inlined.
91 (KJS::isPosInf): Ditto.
92 (KJS::isNegInf): Ditto.
94 * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
95 (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
96 (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
97 (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
98 boolean in, often avoiding a conversion from floating point to integer and back.
101 * kjs/property_map.cpp:
102 (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
103 re-getting them inside the loop.
104 (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
105 look at the value pointer in the mark function.
106 (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
107 re-getting them inside the loop.
108 (KJS::PropertyMap::put): Ditto.
109 (KJS::PropertyMap::insert): Ditto.
110 (KJS::PropertyMap::remove): Ditto.
111 (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
112 re-getting them inside the loop. Don't bother checking key for 0, since we already have
113 to check value for 0. (Also had to change clear() to set value to 0.)
114 (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
115 loop to avoid re-getting them inside the loop.
116 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
117 (KJS::PropertyMap::save): Ditto.
121 * kjs/protected_values.h: Remove unneeded class name qualifiers.
124 (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
125 (KJS::Reference::Reference): Inlined.
127 (KJS::Reference::getValue): Rewrite to not use getBase.
128 (KJS::Reference::putValue): Ditto.
129 (KJS::Reference::deleteValue): Dittol
131 * kjs/simple_number.h:
132 (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
134 * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
135 to double in various cases that involve integers.
138 (KJS::UString::attach): Inlined.
139 (KJS::UString::release): Inlined.
141 (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
144 (Value::Value): Added overloads for all the various specific types of values, so you don't have
145 to convert from, say, Number to Value, just to create one.
146 (Number::Number): Added an overload that takes a boolean to indicate the number is already
147 known to be an integer.
149 * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
150 a boolean to indicate if the number is known to be an integer (because it was a "simple number").
151 (KJS::ValueImp::marked): Inlined.
152 (KJS::ValueImp::dispatchType): Inlined.
153 (KJS::ValueImp::dispatchToPrimitive): Inlined.
154 (KJS::ValueImp::dispatchToBoolean): Inlined.
155 (KJS::ValueImp::dispatchToNumber): Inlined.
156 (KJS::ValueImp::dispatchToString): Inlined.
157 (KJS::ValueImp::dispatchToUInt32): Inlined.
159 2005-04-14 Maciej Stachowiak <mjs@apple.com>
161 - make fast_malloc.h a private header, not project
163 * JavaScriptCore.pbproj/project.pbxproj:
165 2005-04-12 Maciej Stachowiak <mjs@apple.com>
169 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
171 - use custom single-threaded malloc for all non-GC JavaScriptCore
172 allocations, for a 9.1% speedup on JavaScript iBench
174 * JavaScriptCore.pbproj/project.pbxproj:
176 (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
177 (KJS::Collector::collect): And dlfree to free it.
178 * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
179 * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
180 macro to give a class custom operator new/delete
181 * kjs/identifier.cpp:
182 (KJS::Identifier::add): Use dlmalloc/dlfree.
183 * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
184 * kjs/property_map.cpp:
185 (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
186 (KJS::PropertyMap::rehash): ditto
189 (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
190 buffer, to hide allocation details from webcore.
191 (KJS::UString::UString): use createCopying when appropriate.
192 (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
193 (KJS::UString::expandedSize): likewise
194 (KJS::UString::expandCapacity): likewise
195 (KJS::UString::expandPreCapacity): likewise
196 (KJS::UString::spliceSubstringsWithSeparators): likewise
197 (KJS::UString::append): likewise
198 (KJS::UString::operator=): likewise
199 (KJS::UString::detach): likewise
200 * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
202 2005-04-11 Maciej Stachowiak <mjs@apple.com>
206 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
208 - Avoid using protected values hash for the two most common cases
209 - Bump up ListImp high water mark, new testing shows 508 ListImps are
210 created during JS iBench.
212 Net result is a 5.6% speedup on JavaScript iBench
215 (KJS::Collector::collect): mark protected lists as appropriate.
218 (KJS::ListImp::markValues): Moved implementation from List::markValues
219 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
221 (KJS::allocateListImp): link lists outside the pool into a separate
222 doubly linked list to be able to mark protected lists
223 (KJS::deallocateListImp): do the corresponding delinking
224 (KJS::List::derefValues): do nothing in conservative GC mode
225 (KJS::List::refValues): do nothing in conservative GC mode
226 (KJS::List::markValues): call ListImp version
242 2005-03-16 Jens Alfke <jens@apple.com>
246 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
247 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.
248 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.)
249 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
252 (KJS::GlobalFuncImp::call):
254 2005-03-15 Richard Williamson <rjw@apple.com>
256 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
258 Added JavaScript boolean to type that can be converted to
259 ObjC scalar parameters.
261 Reviewed by Ken Kocienda.
263 * bindings/objc/objc_utility.mm:
264 (KJS::Bindings::convertValueToObjcValue):
280 2005-02-21 Darin Adler <darin@apple.com>
282 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
284 2005-02-17 Richard Williamson <rjw@apple.com>
286 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
290 Reviewed by John Sullivan.
292 * bindings/jni/jni_runtime.cpp:
293 (JavaField::valueFromInstance):
297 2005-02-11 Richard Williamson <rjw@apple.com>
299 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
301 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
302 creates these wrappers. The WebCore subclass of the interpreter now overrides
303 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
307 * bindings/c/c_utility.cpp:
308 (convertValueToNPVariant):
309 * bindings/jni/jni_instance.cpp:
310 (JavaInstance::invokeMethod):
311 * bindings/jni/jni_objc.mm:
312 (KJS::Bindings::dispatchJNICall):
313 * bindings/jni/jni_runtime.cpp:
314 (JavaField::valueFromInstance):
315 (JavaArray::valueAt):
316 * bindings/objc/WebScriptObject.mm:
317 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
318 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
319 * bindings/objc/WebScriptObjectPrivate.h:
320 * bindings/objc/objc_utility.h:
321 * bindings/objc/objc_utility.mm:
322 (KJS::Bindings::convertObjcValueToValue):
323 (KJS::Bindings::createObjcInstanceForValue):
324 * bindings/runtime.cpp:
325 (Instance::createBindingForLanguageInstance):
326 (Instance::createRuntimeObject):
327 (Instance::createLanguageInstanceForValue):
328 * bindings/runtime.h:
329 * kjs/interpreter.cpp:
330 (Interpreter::createLanguageInstanceForValue):
335 2005-02-10 Darin Adler <darin@apple.com>
337 "Reviewed" by Richard (he told me the file was obsolete).
339 - got rid of an obsolete file
341 * bindings/npsap.h: Removed.
347 2005-02-03 Richard Williamson <rjw@apple.com>
349 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
351 Revert to old (and correct) behavior of returning runtime object
352 when passed as a parameter, rather than it's corresponding DOM
357 * bindings/objc/WebScriptObject.mm:
358 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
362 2005-01-28 Richard Williamson <rjw@apple.com>
364 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
366 Only use special 'back door' property to get the runtime object if thisObj isn't
367 already a runtime object.
369 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
370 ClassInfo pointer instead.
374 * bindings/c/c_utility.cpp:
375 (convertValueToNPVariant):
376 * bindings/objc/WebScriptObject.mm:
377 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
378 * bindings/runtime_method.cpp:
379 (RuntimeMethodImp::call):
383 2005-01-26 Richard Williamson <rjw@apple.com>
385 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
387 I added a member variable to ObjectImp. This changed it's size and consequently
388 hampered the optimizations built into the garbage collector. Objects no longer
389 fit within the allocators cell size, and thus allocation fell back to a slower
392 As a result of this fix I also dramatically cleaned up how runtime objects are
393 accessed. The path mostly *removes* code.
397 * bindings/runtime_method.cpp:
398 (RuntimeMethodImp::call):
399 * bindings/runtime_object.cpp:
400 (RuntimeObjectImp::get):
401 (RuntimeObjectImp::put):
402 (RuntimeObjectImp::canPut):
403 (RuntimeObjectImp::hasProperty):
404 (RuntimeObjectImp::defaultValue):
405 * bindings/runtime_object.h:
407 (KJS::ObjectImp::ObjectImp):
410 2005-01-20 Darin Adler <darin@apple.com>
412 Reviewed by me, changes by Han Ming Ong.
414 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
416 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
417 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
419 2005-01-20 Richard Williamson <rjw@apple.com>
421 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
423 The comprehensive fix for this problem requires new API, as described in 3965326. However,
424 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
425 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
426 implemented on the bound object.
430 * bindings/objc/objc_runtime.h:
431 * bindings/objc/objc_runtime.mm:
432 (ObjcFallbackObjectImp::type):
433 (ObjcFallbackObjectImp::implementsCall):
434 (ObjcFallbackObjectImp::toBoolean):
435 * bindings/testbindings.mm:
436 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
437 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
441 2005-01-19 Richard Williamson <rjw@apple.com>
443 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
445 Fixed the following problems with LiveConnect that are demonstrated by the application
446 described in 3853676.
448 1. If a nil object is passed in an array from Java to JavaScript we will crash.
449 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
450 3. We will sometimes fail to find the correct static method ID.
454 * bindings/jni/jni_jsobject.cpp:
455 (JSObject::convertJObjectToValue):
456 (JSObject::listFromJArray):
457 * bindings/jni/jni_runtime.cpp:
458 (JavaField::valueFromInstance):
459 (JavaField::setValueToInstance):
460 * bindings/jni/jni_utility.cpp:
461 (KJS::Bindings::getMethodID):
462 (KJS::Bindings::convertValueToJValue):
463 * bindings/runtime_array.h:
465 2005-01-18 Richard Williamson <rjw@apple.com>
467 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
469 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
470 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
471 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
472 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
474 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
475 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
476 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
480 * bindings/objc/objc_instance.h:
481 * bindings/objc/objc_instance.mm:
482 (ObjcInstance::supportsSetValueOfUndefinedField):
483 * bindings/runtime.h:
484 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
485 * bindings/runtime_object.cpp:
486 (RuntimeObjectImp::RuntimeObjectImp):
487 (RuntimeObjectImp::get):
488 (RuntimeObjectImp::put):
489 (RuntimeObjectImp::canPut):
490 (RuntimeObjectImp::hasProperty):
491 (RuntimeObjectImp::defaultValue):
492 * bindings/runtime_object.h:
493 (KJS::RuntimeObjectImp::fallbackObject):
495 (KJS::ObjectImp::ObjectImp):
497 (KJS::ObjectImp::forwardingScriptMessage):
498 (KJS::ObjectImp::setForwardingScriptMessage):
500 2005-01-18 Richard Williamson <rjw@apple.com>
502 Back out a change that was incorrectly committed yesterday.
506 * bindings/objc/objc_utility.mm:
507 (KJS::Bindings::convertValueToObjcValue):
509 2005-01-17 Richard Williamson <rjw@apple.com>
511 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
513 Keep track of originating execution context and target execution
514 context for native JS object wrappers, and perform appropriate
517 Reviewed by David Harrison.
519 * bindings/NP_jsobject.cpp:
521 (_NPN_CreateScriptObject):
526 (_NPN_RemoveProperty):
530 * bindings/NP_jsobject.h:
531 * bindings/c/c_instance.cpp:
532 (CInstance::CInstance):
533 (CInstance::stringValue):
534 * bindings/c/c_instance.h:
535 * bindings/c/c_utility.cpp:
536 (convertValueToNPVariant):
537 * bindings/jni/jni_instance.cpp:
538 (JavaInstance::JavaInstance):
539 (JavaInstance::valueOf):
540 * bindings/jni/jni_instance.h:
541 * bindings/objc/WebScriptObject.mm:
542 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
543 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
544 (-[WebScriptObject KJS::Bindings::]):
545 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
546 (-[WebScriptObject _isSafeScript]):
547 (-[WebScriptObject callWebScriptMethod:withArguments:]):
548 (-[WebScriptObject evaluateWebScript:]):
549 (-[WebScriptObject setValue:forKey:]):
550 (-[WebScriptObject valueForKey:]):
551 (-[WebScriptObject removeWebScriptKey:]):
552 (-[WebScriptObject stringRepresentation]):
553 (-[WebScriptObject webScriptValueAtIndex:]):
554 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
555 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
556 * bindings/objc/WebScriptObjectPrivate.h:
557 * bindings/objc/objc_instance.h:
558 * bindings/objc/objc_runtime.mm:
559 (convertValueToObjcObject):
560 * bindings/objc/objc_utility.mm:
561 (KJS::Bindings::convertValueToObjcValue):
562 * bindings/runtime.cpp:
563 (Instance::Instance):
564 (Instance::operator=):
565 * bindings/runtime.h:
566 (KJS::Bindings::Instance::Instance):
567 (KJS::Bindings::Instance::setExecutionContext):
568 (KJS::Bindings::Instance::executionContext):
569 * bindings/runtime_root.cpp:
570 (RootObject::setInterpreter):
571 * bindings/runtime_root.h:
573 (KJS::Interpreter::isGlobalObject):
574 (KJS::Interpreter::interpreterForGlobalObject):
575 (KJS::Interpreter::isSafeScript):
579 2005-01-13 Vicki Murley <vicki@apple.com>
583 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
585 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
587 2005-01-12 Richard Williamson <rjw@apple.com>
589 Avoid additional work on dealloc by adding early out to
590 removeNativeReference(). (This will save time on dealloc
591 for all ObjC DOM objects.)
595 * bindings/runtime_root.cpp:
596 (KJS::Bindings::removeNativeReference):
598 2005-01-12 Richard Williamson <rjw@apple.com>
600 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
602 We were always returning the first "root" object for all runtime
603 objects. Changed 0 in loop to i, the index.
605 Reviewed by David Harrison.
607 * bindings/runtime_root.cpp:
608 (KJS::Bindings::rootForImp):
610 2005-01-11 Richard Williamson <rjw@apple.com>
612 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
614 Use the new dispatching API to invoke JNI, rather than calling JNI
617 Reviewed by David Harrison.
619 * bindings/jni/jni_instance.cpp:
620 (JavaInstance::invokeMethod):
621 * bindings/jni/jni_runtime.cpp:
622 (JavaField::dispatchValueFromInstance):
623 (JavaField::valueFromInstance):
624 (JavaField::dispatchSetValueToInstance):
625 (JavaField::setValueToInstance):
626 * bindings/jni/jni_runtime.h:
627 * bindings/jni/jni_utility.cpp:
628 (KJS::Bindings::convertValueToJValue):
636 2004-12-17 Maciej Stachowiak <mjs@apple.com>
640 <rdar://problem/3926869> Opening caches window after running PLT causes crash
642 * kjs/protected_values.cpp:
643 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
644 the protected value table.
645 (KJS::ProtectedValues::increaseProtectCount): Ditto.
646 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
648 2004-12-16 Darin Adler <darin@apple.com>
652 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
654 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
655 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
656 non-locale-specific versions.
657 * kjs/string_object.lut.h: Regenerated.
659 2004-12-14 Richard Williamson <rjw@apple.com>
661 Pass URL of plugin view when call into JNI.
665 * bindings/jni/jni_objc.mm:
666 (KJS::Bindings::dispatchJNICall):
668 2004-12-13 Richard Williamson <rjw@apple.com>
670 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
672 Add support for calling static Java methods from JavaScript.
676 * bindings/jni/jni_instance.cpp:
677 (JavaInstance::invokeMethod):
678 * bindings/jni/jni_runtime.cpp:
679 (JavaMethod::JavaMethod):
680 * bindings/jni/jni_runtime.h:
681 (KJS::Bindings::JavaMethod::isStatic):
682 * bindings/jni/jni_utility.cpp:
683 (callJNIStaticMethod):
684 (KJS::Bindings::callJNIBooleanMethod):
685 (KJS::Bindings::callJNIStaticBooleanMethod):
686 * bindings/jni/jni_utility.h:
688 2004-12-13 Richard Williamson <rjw@apple.com>
690 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
694 * bindings/jni/jni_instance.cpp:
695 (JavaInstance::invokeMethod):
696 * bindings/jni/jni_objc.mm:
697 (KJS::Bindings::dispatchJNICall):
698 * bindings/jni/jni_runtime.h:
699 * bindings/jni/jni_utility.h:
703 2004-12-07 Maciej Stachowiak <mjs@apple.com>
707 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
709 The fix was to implement copy constructor and assignment operator,
710 the ones that worked on the base class did not replace the
714 (KJS::ProtectedValue::ProtectedValue):
715 (KJS::ProtectedValue::operator=):
716 (KJS::ProtectedObject::ProtectedObject):
717 (KJS::ProtectedObject::operator=):
719 Also fixed a bug in the GC test mode that compares the results of
720 the old collector and the new collector.
727 2004-11-23 Richard Williamson <rjw@apple.com>
729 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
733 * bindings/c/c_class.cpp:
734 (CClass::_commonInit):
736 2004-11-21 Maciej Stachowiak <mjs@apple.com>
740 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
743 (KJS::Collector::Thread::Thread):
744 (KJS::destroyRegisteredThread):
745 (KJS::initializeRegisteredThreadKey):
746 (KJS::Collector::registerThread):
747 (KJS::Collector::markStackObjectsConservatively):
748 (KJS::Collector::markCurrentThreadConservatively):
749 (KJS::Collector::markOtherThreadConservatively):
757 2004-11-15 Richard Williamson <rjw@apple.com>
759 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
763 * bindings/objc/objc_instance.mm:
764 (ObjcInstance::stringValue):
765 * bindings/objc/objc_utility.h:
766 * bindings/objc/objc_utility.mm:
767 (KJS::Bindings::convertNSStringToString):
768 (KJS::Bindings::convertObjcValueToValue):
772 2004-11-09 Chris Blumenberg <cblu@apple.com>
774 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
779 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
780 * bindings/softlinking.c: Added.
782 (getFunctionPointer): new
783 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
787 2004-11-04 Darin Adler <darin@apple.com>
791 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
792 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
793 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
794 than allocating a new one
796 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
797 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
798 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
799 actually allocate only the very first time it's called.
800 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
801 shared instance since there can be only one).
802 (-[WebUndefined copyWithZone:]): Ditto.
803 (-[WebUndefined retain]): Ditto.
804 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
806 (-[WebUndefined autorelease]): Simplified to just return self (see above).
807 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
808 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
809 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
810 bug mentioned above).
811 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
812 No need to call init, since that's a no-op for this class.
814 2004-11-03 David Harrison <harrison@apple.com>
818 Eliminate the use of a marker file to determine how to build.
823 2004-11-01 Richard Williamson <rjw@apple.com>
825 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
829 * bindings/c/c_instance.cpp:
830 (CInstance::invokeMethod):
831 (CInstance::invokeDefaultMethod):
832 Initialize out parameters to void type.
834 * bindings/c/c_runtime.cpp:
835 (CField::valueFromInstance):
836 (CField::setValueToInstance):
837 Initialize out parameters to void type.
838 Also added additional checks to protect against classes that
839 don't implement all functions.
841 2004-11-01 Richard Williamson <rjw@apple.com>
843 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
848 * bindings/objc/WebScriptObject.mm:
849 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
850 Added additional conversion Undefined -> WebUndefined.
851 * bindings/objc/objc_utility.mm:
852 (KJS::Bindings::convertObjcValueToValue):
853 Added additional conversion WebUndefined -> Undefined.
855 2004-11-01 Darin Adler <darin@apple.com>
857 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
859 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
860 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
861 report to match the contents of the file.
867 2004-10-22 Ken Kocienda <kocienda@apple.com>
871 * JavaScriptCore.pbproj/project.pbxproj:
872 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
876 2004-10-13 Richard Williamson <rjw@apple.com>
878 Moved boolean checks prior to NSNumber checks. booleans are
881 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
885 * bindings/objc/objc_utility.mm:
886 (KJS::Bindings::convertObjcValueToValue):
888 2004-10-12 Richard Williamson <rjw@apple.com>
890 Fixed access to DOM object via WebScriptObject API.
891 The execution context for DOM objects wasn't being found.
892 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
896 * bindings/objc/WebScriptObject.mm:
898 (-[WebScriptObject KJS::Bindings::]):
899 (-[WebScriptObject callWebScriptMethod:withArguments:]):
900 (-[WebScriptObject evaluateWebScript:]):
901 (-[WebScriptObject setValue:forKey:]):
902 (-[WebScriptObject valueForKey:]):
903 (-[WebScriptObject stringRepresentation]):
904 * bindings/objc/WebScriptObjectPrivate.h:
906 2004-10-09 Darin Adler <darin@apple.com>
910 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
912 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
913 creating an init routine.
915 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
916 require a global constructor that creates an init routine.
918 2004-10-09 Darin Adler <darin@apple.com>
922 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
924 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
925 work with the window object of the page the function is in, not the page of the caller. This
926 is what all other browsers do. This code was hidden before by the "everything is defined on
927 window object" hack in WebCore.
929 2004-10-07 Richard Williamson <rjw@apple.com>
931 Added simple JavaScript call tracing. Very useful for
932 debugging complex pages.
934 Tracing is only available in development builds and is
937 (gdb) set traceJavaScript = 1
941 setTraceJavaScript(true)
943 Function, args, and return values are printed to console. Very
948 * kjs/function_object.cpp:
949 (FunctionProtoFuncImp::call):
955 2004-10-05 Richard Williamson <rjw@apple.com>
957 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
961 * bindings/NP_jsobject.cpp:
963 * bindings/npruntime.cpp:
964 (_NPN_SetExceptionWithUTF8):
965 * bindings/objc/WebScriptObject.mm:
966 (+[WebScriptObject throwException:]):
968 (KJS::InterpreterImp::context):
970 2004-10-05 Richard Williamson <rjw@apple.com>
972 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
976 * bindings/objc/objc_utility.mm:
977 (KJS::Bindings::convertObjcValueToValue):
979 2004-10-04 Darin Adler <darin@apple.com>
983 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
985 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
987 - rolled out an old workaround we don't need any more
989 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
990 required it is no longer there.
992 2004-09-30 Richard Williamson <rjw@apple.com>
994 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
998 * bindings/NP_jsobject.cpp:
1002 * bindings/c/c_class.cpp:
1003 (CClass::methodsNamed):
1004 (CClass::fieldNamed):
1005 * bindings/c/c_class.h:
1006 * bindings/c/c_instance.cpp:
1007 (CInstance::invokeMethod):
1008 * bindings/jni/jni_class.cpp:
1009 (JavaClass::methodsNamed):
1010 * bindings/jni/jni_class.h:
1011 * bindings/npruntime.h:
1012 * bindings/objc/objc_class.h:
1013 * bindings/objc/objc_class.mm:
1014 (ObjcClass::methodsNamed):
1015 * bindings/runtime.h:
1016 * bindings/runtime_object.cpp:
1017 (RuntimeObjectImp::get):
1018 (RuntimeObjectImp::hasProperty):
1020 2004-09-29 Chris Blumenberg <cblu@apple.com>
1022 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.
1026 * JavaScriptCore.pbproj/project.pbxproj:
1027 * bindings/NP_jsobject.cpp:
1028 (_NPN_CreateScriptObject):
1029 (_NPN_InvokeDefault):
1034 (_NPN_RemoveProperty):
1037 * bindings/c/c_class.cpp:
1038 (CClass::methodsNamed):
1039 (CClass::fieldNamed):
1040 * bindings/c/c_instance.cpp:
1041 (CInstance::CInstance):
1042 (CInstance::~CInstance):
1043 (CInstance::operator=):
1044 (CInstance::invokeMethod):
1045 (CInstance::invokeDefaultMethod):
1046 * bindings/c/c_runtime.cpp:
1047 * bindings/c/c_runtime.h:
1048 (KJS::Bindings::CField::name):
1049 (KJS::Bindings::CMethod::name):
1050 * bindings/npruntime.cpp:
1051 (_NPN_GetStringIdentifier):
1052 (_NPN_GetStringIdentifiers):
1053 (_NPN_GetIntIdentifier):
1054 (_NPN_IdentifierIsString):
1055 (_NPN_UTF8FromIdentifier):
1056 (_NPN_IntFromIdentifier):
1057 (NPN_InitializeVariantWithObject):
1058 (_NPN_ReleaseVariantValue):
1059 (_NPN_CreateObject):
1060 (_NPN_RetainObject):
1061 (_NPN_ReleaseObject):
1062 (_NPN_SetExceptionWithUTF8):
1063 (_NPN_SetException):
1065 2004-09-26 Darin Adler <darin@apple.com>
1067 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
1068 low() to get Unicode value of character, and just use unicode().
1070 2004-09-26 Darin Adler <darin@apple.com>
1072 - refine charAt/charCodeAt fix slightly
1074 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
1075 omitted parameter, as we do everywhere else, and as other browsers do here.
1077 2004-09-26 Darin Adler <darin@apple.com>
1081 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
1083 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
1084 the program. We were doing this properly for functions, but not entire programs.
1086 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
1088 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
1089 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
1091 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
1097 2004-09-14 Richard Williamson <rjw@apple.com>
1099 1. Add class parameter to object allocation function. This is somewhat redundant, given that
1100 the allocation function is in the class function vector, but people wanted to use the same
1101 allocation function for different classes.
1103 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
1105 3. Add support for a default function on an object. This is a feature that ActiveX supports,
1106 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
1107 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
1108 'Objective-C' bindings.
1110 There bugs are covered by
1112 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
1113 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
1114 <rdar://problem/3674754> Need to implement latest npruntime.h
1118 * bindings/NP_jsobject.cpp:
1120 (NPN_InvokeDefault):
1122 * bindings/c/c_class.cpp:
1123 * bindings/c/c_instance.cpp:
1124 (CInstance::CInstance):
1125 (CInstance::operator=):
1126 (CInstance::invokeMethod):
1127 (CInstance::invokeDefaultMethod):
1128 * bindings/c/c_instance.h:
1129 * bindings/c/c_runtime.cpp:
1130 * bindings/c/c_runtime.h:
1131 * bindings/jni/jni_instance.cpp:
1132 (JavaInstance::invokeDefaultMethod):
1133 * bindings/jni/jni_instance.h:
1134 * bindings/npruntime.cpp:
1136 * bindings/npruntime.h:
1137 * bindings/objc/WebScriptObject.h:
1138 * bindings/objc/objc_class.mm:
1139 (ObjcClass::fallbackObject):
1140 * bindings/objc/objc_instance.h:
1141 * bindings/objc/objc_instance.mm:
1142 (ObjcInstance::invokeDefaultMethod):
1143 * bindings/objc/objc_runtime.h:
1144 * bindings/objc/objc_runtime.mm:
1145 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1146 (ObjcFallbackObjectImp::get):
1147 (ObjcFallbackObjectImp::put):
1148 (ObjcFallbackObjectImp::canPut):
1149 (ObjcFallbackObjectImp::implementsCall):
1150 (ObjcFallbackObjectImp::call):
1151 (ObjcFallbackObjectImp::hasProperty):
1152 (ObjcFallbackObjectImp::deleteProperty):
1153 (ObjcFallbackObjectImp::defaultValue):
1154 * bindings/runtime.h:
1155 (KJS::Bindings::Class::fallbackObject):
1156 (KJS::Bindings::Instance::getValueOfUndefinedField):
1157 (KJS::Bindings::Instance::setValueOfUndefinedField):
1158 (KJS::Bindings::Instance::valueOf):
1159 * bindings/runtime_object.cpp:
1160 (RuntimeObjectImp::implementsCall):
1161 (RuntimeObjectImp::call):
1162 * bindings/runtime_object.h:
1164 2004-09-13 Maciej Stachowiak <mjs@apple.com>
1168 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1170 * kjs/string_object.cpp:
1171 (StringProtoFuncImp::call): Replaced implementation of replace()
1172 method with function below...
1173 (replace): In order to avoid excessive allocation and copying,
1174 figure out the ranges of the original string and replacement
1175 strings to be assembled, instead of constantly creating new
1176 strings at each substitution. The old behavior is basically O(N^2)
1177 for a global replace on a pattern that matches many places in the
1179 (regExpIsGlobal): Helper function for the above.
1180 (expandSourceRanges): ditto
1181 (pushSourceRange): ditto
1182 (expandReplacements): ditto
1183 (pushReplacement): ditto
1185 (KJS::UString::spliceSubstringsWithSeparators): New method that
1186 pieces together substring ranges of this string together with
1187 specified separators, all at one go.
1189 (KJS::UString::Range::Range): Added new helper class to represent
1192 2004-09-14 Maciej Stachowiak <mjs@apple.com>
1196 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1199 (KJS::GlobalFuncImp::call): Make sure to escape null
1200 characters. This is a bug in the new code that made part of the
1203 2004-09-13 Darin Adler <darin@apple.com>
1205 Reviewed by Kevin and Maciej.
1207 - new function to support fix for DIG bug in WebCore
1209 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1210 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1212 2004-09-12 Darin Adler <darin@apple.com>
1214 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1215 of escape and unescape.
1217 2004-09-12 Darin Adler <darin@apple.com>
1221 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1223 * kjs/date_object.cpp:
1224 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1225 uses CFDateFormatter.
1226 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1228 2004-09-09 Maciej Stachowiak <mjs@apple.com>
1230 Reviewed by Richard.
1232 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1235 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1236 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1238 (Lexer::isHexDigit): Made static and non-const.
1243 2004-09-06 Darin Adler <darin@apple.com>
1245 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1249 2004-09-01 Richard Williamson <rjw@apple.com>
1251 Add pid to exception messages (to help debug dashboard clients).
1255 * kjs/interpreter.cpp:
1256 (Interpreter::evaluate):
1260 2004-08-20 Richard Williamson <rjw@apple.com>
1262 Implemented new JNI abstraction. We no longer invoke Java methods
1263 directly with JNI, rather we call into the plugin. This allows the
1264 plugin to dispatch the call to the appropriate VM thread. This
1265 change should (will?) fix a whole class of threading related problems with
1270 * JavaScriptCore.pbproj/project.pbxproj:
1271 * bindings/c/c_instance.h:
1272 (KJS::Bindings::CInstance::setExecutionContext):
1273 (KJS::Bindings::CInstance::executionContext):
1274 * bindings/jni/jni_instance.cpp:
1275 (JavaInstance::JavaInstance):
1276 (JavaInstance::invokeMethod):
1277 (JavaInstance::setExecutionContext):
1278 (JavaInstance::executionContext):
1279 * bindings/jni/jni_instance.h:
1280 * bindings/jni/jni_jsobject.cpp:
1281 (JSObject::convertJObjectToValue):
1282 * bindings/jni/jni_runtime.cpp:
1283 (JavaField::JavaField):
1284 (JavaArray::convertJObjectToArray):
1285 (JavaField::valueFromInstance):
1286 (JavaArray::JavaArray):
1287 (JavaArray::valueAt):
1288 * bindings/jni/jni_runtime.h:
1289 (KJS::Bindings::JavaArray::operator=):
1290 (KJS::Bindings::JavaArray::executionContext):
1291 * bindings/jni/jni_utility.h:
1292 * bindings/objc/objc_instance.h:
1293 (KJS::Bindings::ObjcInstance::setExecutionContext):
1294 (KJS::Bindings::ObjcInstance::executionContext):
1295 * bindings/runtime.cpp:
1296 (Instance::createBindingForLanguageInstance):
1297 * bindings/runtime.h:
1298 * bindings/runtime_root.h:
1299 (KJS::Bindings::RootObject::nativeHandle):
1303 2004-08-19 Vicki Murley <vicki@apple.com>
1307 * kjs/property_map.cpp:
1308 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1310 2004-08-17 Darin Adler <darin@apple.com>
1314 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1316 * kjs/property_map.h: Added some private functions.
1317 * kjs/property_map.cpp:
1318 (KJS::PropertyMap::clear): Set sentinelCount to 0.
1319 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1320 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1321 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1322 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1323 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1324 deleted-element sentinels.
1325 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1327 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1329 Code change by Eric Albert, reviewd by me.
1331 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1333 * kjs/date_object.cpp:
1334 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1335 entirely would be even better, but is not required to fix this bug.
1339 2004-08-16 Richard Williamson <rjw@apple.com>
1341 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1343 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1347 * bindings/NP_jsobject.cpp:
1349 * bindings/jni/jni_jsobject.cpp:
1351 * bindings/objc/WebScriptObject.mm:
1352 (-[WebScriptObject evaluateWebScript:]):
1354 2004-08-15 Richard Williamson <rjw@apple.com>
1356 More updates to np headers. Implemented new NPN functions.
1360 * bindings/NP_jsobject.cpp:
1364 * bindings/npruntime.h:
1366 2004-08-13 Darin Adler <darin@apple.com>
1368 - fix build so we can compile again
1370 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1371 is good enough so that we can compile, but it's only a stopgap measure, because I think
1372 Richard has a newer one he wants to check in.
1374 2004-08-12 Richard Williamson <rjw@apple.com>
1376 Bring npruntime.h and friends closer to compliance with
1381 * JavaScriptCore.pbproj/project.pbxproj:
1382 * bindings/NP_jsobject.cpp:
1384 (_NPN_CreateScriptObject):
1389 (NPN_RemoveProperty):
1390 * bindings/NP_jsobject.h:
1391 * bindings/c/c_instance.cpp:
1392 (CInstance::invokeMethod):
1393 * bindings/c/c_utility.cpp:
1394 (convertNPVariantToValue):
1395 * bindings/npruntime.cpp:
1396 (NPN_IdentifierIsString):
1397 (NPN_VariantIsVoid):
1398 (NPN_VariantIsNull):
1399 (NPN_VariantIsUndefined):
1400 (NPN_VariantIsBool):
1401 (NPN_VariantIsInt32):
1402 (NPN_VariantIsDouble):
1403 (NPN_VariantIsString):
1404 (NPN_VariantIsObject):
1405 (NPN_VariantToBool):
1406 (NPN_VariantToString):
1407 (NPN_VariantToInt32):
1408 (NPN_VariantToDouble):
1409 (NPN_VariantToObject):
1410 (NPN_InitializeVariantAsVoid):
1411 (NPN_InitializeVariantAsNull):
1412 (NPN_InitializeVariantAsUndefined):
1413 (NPN_InitializeVariantWithBool):
1414 (NPN_InitializeVariantWithInt32):
1415 (NPN_InitializeVariantWithDouble):
1416 (NPN_InitializeVariantWithString):
1417 (NPN_InitializeVariantWithStringCopy):
1418 (NPN_InitializeVariantWithObject):
1419 (NPN_InitializeVariantWithVariant):
1420 (NPN_ReleaseVariantValue):
1422 * bindings/npruntime.h:
1424 (_NPString::_NPVariant::):
1425 * bindings/npruntime_priv.h: Added.
1427 2004-08-12 Darin Adler <darin@apple.com>
1431 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1434 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1435 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1436 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1437 to skip leading "+" or "-".
1441 2004-08-12 Darin Adler <darin@apple.com>
1445 - fixed 43 Mozilla JavaScript tests
1447 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1448 * kjs/date_object.cpp:
1449 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1450 than constructing a number object to pass to it.
1451 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1452 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1453 (KJS::timeClip): Implement this as specified in the language standard.
1455 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1456 flags on the prototype property.
1459 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1461 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1463 (KJS::parseDigit): Added. Helper function for parseInt.
1464 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1465 strtoll can handle. Also matches standard more closely.
1466 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1468 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1470 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1472 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1474 (Lexer::setCode): Clear error state.
1475 (Lexer::lex): Set error state if the lexer encounters an error
1478 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1479 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1481 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1482 Change round to round values between -0.5 and -0 to -0 instead of +0.
1484 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1485 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1486 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1487 would change x.y into a value that can't be deleted as a side effect.
1489 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1492 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1493 get rid of the fixed size limit for code.
1495 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1496 returns the string without creating a new Rep, since I'm using substr in a place where it will
1497 often be passed a 0.
1499 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1500 the other day that was making a couple tests fail.
1501 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1502 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1503 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1504 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1505 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1507 * kjs/string_object.lut.h: Regenerated.
1509 2004-08-11 Darin Adler <darin@apple.com>
1511 - fixed a tiny problem with the UTF-16 PCRE check-in
1513 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1514 the ctype_meta flag to get set in items that should not have it.
1516 * pcre/chartables.c: Regenerated.
1518 2004-08-10 Richard Williamson <rjw@apple.com>
1520 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1522 The following WebScripting methods are now supported on bound
1525 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1526 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1527 - (id)valueForUndefinedKey:(NSString *)key
1531 * bindings/c/c_class.cpp:
1532 (CClass::fieldNamed):
1533 * bindings/c/c_class.h:
1534 * bindings/jni/jni_class.cpp:
1535 (JavaClass::fieldNamed):
1536 * bindings/jni/jni_class.h:
1537 * bindings/objc/objc_class.h:
1538 (KJS::Bindings::ObjcClass::isa):
1539 * bindings/objc/objc_class.mm:
1540 (ObjcClass::methodsNamed):
1541 (ObjcClass::fieldNamed):
1542 (ObjcClass::fallbackObject):
1543 * bindings/objc/objc_instance.h:
1544 * bindings/objc/objc_instance.mm:
1545 (ObjcInstance::invokeMethod):
1546 (ObjcInstance::setValueOfField):
1547 (ObjcInstance::setValueOfUndefinedField):
1548 (ObjcInstance::getValueOfField):
1549 (ObjcInstance::getValueOfUndefinedField):
1550 * bindings/objc/objc_runtime.h:
1551 (KJS::Bindings::ObjcField::~ObjcField):
1552 (KJS::Bindings::ObjcField::ObjcField):
1553 (KJS::Bindings::ObjcField::operator=):
1554 (KJS::Bindings::FallbackObjectImp::classInfo):
1555 * bindings/objc/objc_runtime.mm:
1556 (ObjcField::ObjcField):
1559 (ObjcField::valueFromInstance):
1560 (ObjcField::setValueToInstance):
1561 (FallbackObjectImp::FallbackObjectImp):
1562 (FallbackObjectImp::get):
1563 (FallbackObjectImp::put):
1564 (FallbackObjectImp::canPut):
1565 (FallbackObjectImp::implementsCall):
1566 (FallbackObjectImp::call):
1567 (FallbackObjectImp::hasProperty):
1568 (FallbackObjectImp::deleteProperty):
1569 (FallbackObjectImp::defaultValue):
1570 * bindings/runtime.h:
1571 (KJS::Bindings::Class::fallbackObject):
1572 (KJS::Bindings::Instance::getValueOfUndefinedField):
1573 (KJS::Bindings::Instance::setValueOfUndefinedField):
1574 * bindings/runtime_object.cpp:
1575 (RuntimeObjectImp::get):
1576 (RuntimeObjectImp::put):
1577 (RuntimeObjectImp::canPut):
1578 (RuntimeObjectImp::hasProperty):
1579 * bindings/testbindings.mm:
1580 (-[MyFirstInterface valueForUndefinedKey:]):
1581 (-[MyFirstInterface setValue:forUndefinedKey:]):
1583 2004-08-10 Darin Adler <darin@apple.com>
1587 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1589 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1590 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1591 that need to use it.
1592 * pcre/pcre.c: Add UTF-16 support to all functions.
1593 * pcre/study.c: Ditto.
1595 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1596 the mode. Changed declarations to use symbolic constants and typedefs so we size
1597 things to ichar when needed.
1599 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1600 sized to 16-bit characters instead of 8-bit.
1603 (pcre_copy_substring): Use pcre_char instead of char.
1604 (pcre_get_substring_list): Ditto.
1605 (pcre_free_substring_list): Ditto.
1606 (pcre_get_substring): Ditto.
1607 (pcre_free_substring): Ditto.
1609 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1610 of hard-coding 8-bit table sizes.
1612 * pcre/chartables.c: Regenerated.
1614 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1615 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1616 is not null. The null string still has a null pointer. This prevents us from
1617 passing a null through to the regular expression engine (which results in a null
1618 error even when the string length is 0).
1621 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1622 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1624 2004-08-09 Darin Adler <darin@apple.com>
1628 - fixed 28 Mozilla JavaScript tests
1630 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1631 checking the number of arguments for the join method.
1633 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1634 than integers, so we aren't limited to 32 bits.
1636 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1637 the implementation of the pow operation. Also simplied a case that was handling positive
1638 and negative infinity separately.
1640 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1641 putting them in a long, so that unsigned shift will work properly.
1643 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1645 * kjs/operations.cpp:
1646 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1647 sign of isinf; our isinf function returns +1 even for negative infinity.
1648 (KJS::isNegInf): And again.
1649 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1650 Our floating point already handles the various infinity cases correctly.
1652 * kjs/regexp_object.cpp:
1653 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1654 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1655 array in cases where we did not match.
1656 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1657 "global", "ignoreCase", "multiline", and "source".
1659 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1660 string into undefined rather than an empty string. For the slice method, handle an
1661 undefined parameter for the limit properly as decribed in the specification, and add
1662 the limit to one case that didn't have the limit at all. For the methods that generate
1663 HTML strings, use lowercase tags instead of uppercase.
1666 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1667 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1668 (KJS::UString::append): Fix some math that caused a buffer overflow.
1669 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1670 flag) rather than converting them all to 0.
1671 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1673 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1675 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1676 the Unicode specification in a few cases where it was wrong before.
1677 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1678 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1679 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1680 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1681 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1682 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1683 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1684 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1685 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1687 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1689 * kjs/number_object.lut.h: Regenerated.
1691 2004-08-09 Darin Adler <darin@apple.com>
1695 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1697 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1698 we get a buffer overflow.
1702 2004-08-05 Richard Williamson <rjw@apple.com>
1704 Fixed part of 3674747. The QT guys need this for feature freeze.
1706 This patch implements support for the
1708 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1710 method of objects bound to JavaScript.
1715 * bindings/objc/objc_class.mm:
1716 (ObjcClass::methodsNamed):
1717 (ObjcClass::fieldNamed):
1718 * bindings/objc/objc_instance.mm:
1719 (ObjcInstance::invokeMethod):
1720 * bindings/objc/objc_runtime.h:
1721 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1722 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1723 (KJS::Bindings::ObjcMethod::javaScriptName):
1724 * bindings/objc/objc_runtime.mm:
1725 (ObjcMethod::ObjcMethod):
1726 (ObjcMethod::getMethodSignature):
1727 (ObjcMethod::setJavaScriptName):
1728 * bindings/testbindings.mm:
1730 2004-08-04 Vicki Murley <vicki@apple.com>
1734 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1737 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1738 go to the next line and continue parsing the string (instead of failing). This matches
1739 behavior in Mac IE and Mozilla.
1741 2004-08-03 Kevin Decker <kdecker@apple.com>
1745 Rolled in changes from the latest KJS sources that support additional
1746 Number.prototype functions.
1748 Specifically this patch covers the follow parts of the ECMA 3 spec:
1749 15.7.4.5, 15.7.4.6, and 15.7.4.7
1752 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1753 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1754 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1756 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1757 list of supported identifiers (a macro).
1758 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1759 and toExponential().
1760 (NumberPrototypeImp::NumberPrototypeImp):
1761 (NumberProtoFuncImp::call):
1762 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1764 (KJS::NumberProtoFuncImp::):
1765 * tests/mozilla/expected.html: Update results.
1767 2004-08-03 Darin Adler <darin@apple.com>
1771 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1773 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1774 we are supposed to just copy the regular expression object, and do so.
1775 Also tighten up arguments check to handle case where an actual "undefined"
1776 is passed rather than just omitting an argument.
1778 * tests/mozilla/expected.html: Update results.
1780 2004-08-02 Darin Adler <darin@apple.com>
1782 * tests/mozilla/.cvsignore: Added.
1783 * tests/mozilla/expected.html: Update results.
1785 2004-08-02 Darin Adler <darin@apple.com>
1789 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1791 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1792 Append the flags here so more tests paseed.
1794 2004-08-02 Darin Adler <darin@apple.com>
1798 - fixed a couple things making 5 Mozilla regexp tests pass
1800 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1802 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1803 be used as the flags string when no parameter was passed.
1805 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1806 Added a class info object for RegExp prototype so it can return
1807 a string instead of raising an exception when converting to a string.
1809 * tests/mozilla/expected.html: Update results.
1811 2004-08-02 Darin Adler <darin@apple.com>
1815 - fix crashes in mozilla tests due to mishandling NaN
1817 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1818 calls to toInteger so that NaN will get turned into something that fits in an integer.
1819 These were the ones John already fixed, but his fix used isnan and the new fix is
1822 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1823 after a call to toInteger to handle NaN properly. Also removed separate check
1824 for undefined that's not needed.
1826 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1827 as in the above two files, but for a lot more functions. Also changed one place with
1828 an explicit check for undefined to instead just check isNaN.
1830 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1831 like me who don't keep $SYMROOTS in their $PATH.
1837 2004-07-26 Kevin Decker <kdecker@apple.com>
1839 Changes done by Darin, reviewed by Kevin.
1841 - changed testkjs to build in Xcode rather than from Makefile
1843 * .cvsignore: Removed obsolete files from this list.
1844 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1845 Changed to build target "All" rather than default target. This makes us
1846 build the testkjs test tool.
1847 * dummy.cpp: Removed.
1848 * kjs/.cvsignore: Removed obsolete files from this list, including
1849 the testkjs tool, which is now built in the symroots directory.
1850 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1851 changed this file. Also this has the nice side effect of causing the tool
1852 to be rebuilt in the new location even if there are no other changes in
1853 your tree when you check this out.
1854 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1855 without setting the execute bit on jsDriver.pl.
1857 2004-07-22 Kevin Decker <kdecker@apple.com>
1861 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1863 * kjs/function_object.cpp:
1864 (FunctionObjectImp::construct):
1865 * kjs/function_object.h:
1867 (KJS::ObjectImp::construct):
1869 (KJS::Object::construct):
1871 2004-07-21 Darin Adler <darin@apple.com>
1873 * bindings/npruntime.h: Fixed typo.
1875 2004-07-19 John Sullivan <sullivan@apple.com>
1879 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1880 vulnerability in my patch for 3714644
1882 * kjs/array_object.cpp:
1883 (ArrayProtoFuncImp::call):
1884 handle NAN parameters passed to slice() by clamping to 0 and length.
1886 2004-07-19 Richard Williamson <rjw@apple.com>
1888 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1893 * bindings/jni/jni_jsobject.cpp:
1895 (JSObject::JSObject):
1897 2004-07-16 John Sullivan <sullivan@apple.com>
1901 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1902 hangs browser with javascript
1904 * kjs/array_object.cpp:
1905 (ArrayProtoFuncImp::call):
1906 Check for undefined type for args[0] the same way we were already checking
1907 for args[1]. In this case, args was zero-length, but we were treating
1908 args[0] like an integer anyway. Resulted in some code looping from a NAN
1909 value to 4, taking approximately forever.
1911 * JavaScriptCore.pbproj/project.pbxproj:
1916 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1920 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1921 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1923 * kjs/number_object.cpp:
1924 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1926 2004-07-13 Kevin Decker <kdecker@apple.com>
1928 Reviewed by kocienda.
1930 - made testkjs and JavaScriptCore a subtarget of 'All'
1931 - testkjs now builds in $SYMROOTS
1933 * JavaScriptCore.pbproj/project.pbxproj:
1937 2004-06-24 Chris Blumenberg <cblu@apple.com>
1939 Ignore .mode1 files in JavaScriptCore.pbproj
1941 Reviewed by kocienda.
1943 * JavaScriptCore.pbproj/.cvsignore:
1945 2004-06-23 Richard Williamson <rjw@apple.com>
1947 Implemented changes for latest npruntime.h.
1951 * JavaScriptCore.pbproj/project.pbxproj:
1952 * bindings/NP_jsobject.cpp:
1953 (listFromVariantArgs):
1954 (identiferFromNPIdentifier):
1955 (_NPN_CreateScriptObject):
1960 (NPN_RemoveProperty):
1961 * bindings/NP_jsobject.h:
1962 * bindings/c/c_class.cpp:
1963 (CClass::methodsNamed):
1964 (CClass::fieldNamed):
1965 * bindings/c/c_instance.cpp:
1966 (CInstance::invokeMethod):
1967 * bindings/c/c_utility.cpp:
1968 (convertNPVariantToValue):
1969 * bindings/c/c_utility.h:
1970 * bindings/npruntime.cpp:
1971 (stringIdentifierEqual):
1972 (stringIdentifierHash):
1973 (getStringIdentifierDictionary):
1974 (intIdentifierEqual):
1975 (intIdentifierHash):
1976 (getIntIdentifierDictionary):
1977 (NPN_GetStringIdentifier):
1978 (NPN_GetStringIdentifiers):
1979 (NPN_GetIntIdentifier):
1980 (NPN_IdentifierIsString):
1981 (NPN_UTF8FromIdentifier):
1982 (NPN_VariantToInt32):
1983 (NPN_VariantToDouble):
1985 * bindings/npruntime.h:
1986 * bindings/objc/WebScriptObject.mm:
1987 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1988 * bindings/runtime_object.cpp:
1989 (RuntimeObjectImp::~RuntimeObjectImp):
1990 * bindings/runtime_root.cpp:
1991 (KJS::Bindings::rootForInterpreter):
1992 * bindings/testbindings.cpp:
1993 (initializeIdentifiers):
1999 === JavaScriptCore-146.1 ===
2001 2004-06-16 Richard Williamson <rjw@apple.com>
2003 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
2005 This turned out to be a show stopper for Dashboard. Accessing a nil
2006 ObjC property from JS caused a crash. Similar to the problem
2007 3696112 fixed below.
2011 * bindings/objc/objc_runtime.mm:
2012 (KJS::Bindings::ObjcField::valueFromInstance):
2016 2004-06-16 Richard Williamson <rjw@apple.com>
2018 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
2020 This turned out to be a show stopper for Dashboard. We now
2021 return Undefined() when nil is returned from a ObjC method
2022 that returns an object type.
2026 * bindings/objc/objc_utility.mm:
2027 (KJS::Bindings::convertObjcValueToValue):
2031 2004-06-15 Richard Williamson <rjw@apple.com>
2033 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
2035 No longer need to check respondsToSelector: for
2036 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
2037 because these now have a default implementation on NSObject.
2041 * bindings/objc/objc_class.mm:
2042 (ObjcClass::methodsNamed):
2043 (ObjcClass::fieldNamed):
2045 2004-06-14 Darin Adler <darin@apple.com>
2049 - fixed some things for GC that Patrick missed, or that happened after the branch
2051 * bindings/objc/WebScriptObject.mm:
2052 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
2053 (-[WebScriptObject finalize]): Added.
2055 - added some missing nil checks
2057 * bindings/objc/objc_instance.mm:
2058 (ObjcInstance::ObjcInstance): Check for nil.
2059 (ObjcInstance::~ObjcInstance): Check for nil.
2060 (ObjcInstance::operator=): Check for nil.
2062 2004-06-14 Darin Adler <darin@apple.com>
2064 Reviewed by me, code changes by Patrick Beard.
2066 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
2068 * bindings/objc/objc_instance.mm:
2069 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
2070 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
2071 (ObjcInstance::operator=): More of the same.
2072 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
2074 * bindings/objc/objc_runtime.mm:
2075 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
2076 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
2077 (ObjcArray::operator=): More of the same.
2079 * bindings/testbindings.mm: Fixed incorrect license.
2080 (main): Use [pool drain] if compiling on Tiger.
2084 2004-06-10 Kevin Decker <kdecker@apple.com>
2090 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2092 (KJS::Lexer::lineNo):
2093 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2095 === JavaScriptCore-143.2 ===
2097 2004-06-07 Darin Adler <darin@apple.com>
2099 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
2101 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
2102 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
2104 === JavaScriptCore-143.1 ===
2106 2004-06-04 Kevin Decker <kdecker@apple.com>
2110 - fixed <rdar://problem/3680594>
2113 (KJS::Error::create):
2117 2004-06-04 Darin Adler <darin@apple.com>
2119 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
2121 2004-06-04 Kevin Decker <kdecker@apple.com>
2125 - ObjC bindings do not (yet) pass along sourceurl or line numbers
2126 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
2127 - changed the wording of an error message
2128 - the lexer, parser, and interpreter have been made "sourceURL aware"
2129 - stored the url into Error
2131 * bindings/NP_jsobject.cpp:
2133 * bindings/jni/jni_jsobject.cpp:
2135 * bindings/objc/WebScriptObject.mm:
2136 (-[WebScriptObject evaluateWebScript:]):
2138 (GlobalFuncImp::call):
2139 * kjs/function_object.cpp:
2140 (FunctionObjectImp::construct):
2143 (InterpreterImp::checkSyntax):
2144 (InterpreterImp::evaluate):
2146 * kjs/interpreter.cpp:
2147 (Interpreter::evaluate):
2148 * kjs/interpreter.h:
2152 (KJS::Lexer::sourceURL):
2156 (FunctionCallNode::evaluate):
2159 (KJS::Error::create):
2162 2004-06-04 Richard Williamson <rjw@apple.com>
2164 Fixed crash when attempting to access properties on nil
2169 * bindings/objc/objc_instance.mm:
2170 (ObjcInstance::getClass):
2171 * bindings/runtime_object.cpp:
2172 (RuntimeObjectImp::get):
2173 * bindings/testM.js:
2174 * bindings/testbindings.mm:
2175 (-[MyFirstInterface getString]):
2177 2004-05-27 Kevin Decker <kdecker@apple.com>
2181 -revised generated error message content
2183 * kjs/error_object.cpp:
2184 (ErrorProtoFuncImp::call):
2188 (KJS::Error::create):
2192 2004-05-27 Richard Williamson <rjw@apple.com>
2194 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2198 * bindings/objc/WebScriptObject.h:
2200 2004-05-27 Darin Adler <darin@apple.com>
2204 - moved to new symlink technique for embedding frameworks
2206 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2207 because we don't need it any more.
2209 2004-05-24 Richard Williamson <rjw@apple.com>
2211 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2212 fixed ClassInfo to correctly reflect inheritance. This is required
2213 because of the runtime checks in JSC for arrays, i.e. in
2214 the Function objects apply method.
2218 * bindings/jni/jni_runtime.cpp:
2219 (JavaArray::convertJObjectToArray):
2220 * bindings/objc/objc_utility.mm:
2221 (KJS::Bindings::convertObjcValueToValue):
2222 * bindings/runtime_array.cpp:
2223 (RuntimeArrayImp::RuntimeArrayImp):
2224 * bindings/runtime_array.h:
2225 * bindings/testM.js: Added.
2226 * bindings/testbindings.mm:
2227 (+[MyFirstInterface webScriptNameForSelector:]):
2228 (-[MyFirstInterface logMessages:]):
2229 (-[MyFirstInterface logMessage:prefix:]):
2230 (-[MyFirstInterface callJSObject::]):
2232 2004-05-22 Darin Adler <darin@apple.com>
2236 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2238 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2239 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2240 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2241 it hasn't been set explicitly.
2245 2004-05-20 Richard Williamson <rjw@apple.com>
2247 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
2248 can now be referenced like any other WebScriptObject, meaning
2249 you can do JS operations on them.
2251 All added implementation of finalizeForWebScript.
2255 * bindings/objc/WebScriptObject.h:
2256 * bindings/objc/WebScriptObject.mm:
2257 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2258 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2259 (-[WebScriptObject KJS::]):
2260 (-[WebScriptObject dealloc]):
2261 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2262 (-[WebScriptObject evaluateWebScript:]):
2263 (-[WebScriptObject setValue:forKey:]):
2264 (-[WebScriptObject valueForKey:]):
2265 (-[WebScriptObject stringRepresentation]):
2266 * bindings/objc/WebScriptObjectPrivate.h:
2267 * bindings/objc/objc_instance.mm:
2268 (ObjcInstance::~ObjcInstance):
2270 2004-05-19 Richard Williamson <rjw@apple.com>
2272 Removed extraneous tabs that were added (by XCode?).
2274 * bindings/objc/WebScriptObject.h:
2276 2004-05-19 Darin Adler <darin@apple.com>
2278 - fixed headers with licenses mangled by Xcode auto-indenting
2280 * bindings/jni/jni_jsobject.cpp:
2281 * bindings/jni/jni_jsobject.h:
2282 * bindings/runtime_array.h:
2283 * bindings/runtime_root.cpp:
2284 * bindings/runtime_root.h:
2286 2004-05-18 Richard Williamson <rjw@apple.com>
2288 Added exception logging. Also check for exception and
2289 set results as appropriate.
2291 Reviewed by Maciej (partially reviewed).
2293 * bindings/objc/WebScriptObject.mm:
2294 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2295 (-[WebScriptObject evaluateWebScript:]):
2296 (-[WebScriptObject setValue:forKey:]):
2297 (-[WebScriptObject valueForKey:]):
2299 2004-05-18 Richard Williamson <rjw@apple.com>
2301 Finsished implementing support for windowScriptObject.
2302 Had to make WebScriptObjectPrivate.h accessible from
2307 * JavaScriptCore.pbproj/project.pbxproj:
2308 * bindings/objc/WebScriptObjectPrivate.h:
2310 2004-05-18 Richard Williamson <rjw@apple.com>
2312 Use KVC to set/get values instead of directly accessing
2317 * bindings/objc/WebScriptObject.mm:
2318 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2319 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2320 * bindings/objc/objc_runtime.mm:
2321 (ObjcField::valueFromInstance):
2322 (convertValueToObjcObject):
2323 (ObjcField::setValueToInstance):
2325 2004-05-17 Richard Williamson <rjw@apple.com>
2327 Implemented new API for WebScriptObject.
2329 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2330 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
2334 * JavaScriptCore.pbproj/project.pbxproj:
2335 * bindings/c/c_instance.cpp:
2336 (CInstance::invokeMethod):
2337 * bindings/jni/jni_instance.cpp:
2338 (JavaInstance::invokeMethod):
2339 * bindings/jni/jni_jsobject.cpp:
2340 (JSObject::convertValueToJObject):
2341 * bindings/jni/jni_utility.cpp:
2342 (KJS::Bindings::getJNIField):
2343 * bindings/objc/WebScriptObject.mm:
2345 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2346 (-[WebScriptObject KJS::]):
2347 (-[WebScriptObject dealloc]):
2348 (+[WebScriptObject throwException:]):
2350 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2351 (-[WebScriptObject evaluateWebScript:]):
2352 (-[WebScriptObject setValue:forKey:]):
2353 (-[WebScriptObject valueForKey:]):
2354 (-[WebScriptObject stringRepresentation]):
2355 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2356 (+[WebUndefined undefined]):
2357 (-[WebUndefined initWithCoder:]):
2358 (-[WebUndefined encodeWithCoder:]):
2359 (-[WebUndefined copyWithZone:]):
2360 (-[WebUndefined retain]):
2361 (-[WebUndefined release]):
2362 (-[WebUndefined retainCount]):
2363 (-[WebUndefined autorelease]):
2364 (-[WebUndefined dealloc]):
2365 (-[WebUndefined copy]):
2366 (-[WebUndefined replacementObjectForPortCoder:]):
2367 * bindings/objc/WebScriptObjectPrivate.h: Added.
2368 * bindings/objc/objc_class.mm:
2369 (ObjcClass::methodsNamed):
2370 (ObjcClass::fieldNamed):
2371 * bindings/objc/objc_instance.mm:
2372 (ObjcInstance::invokeMethod):
2373 * bindings/objc/objc_jsobject.h:
2374 * bindings/objc/objc_jsobject.mm:
2375 * bindings/objc/objc_runtime.mm:
2376 (ObjcField::valueFromInstance):
2377 * bindings/objc/objc_utility.mm:
2378 (KJS::Bindings::JSMethodNameToObjCMethodName):
2379 (KJS::Bindings::convertValueToObjcValue):
2380 (KJS::Bindings::convertObjcValueToValue):
2381 * bindings/runtime.cpp:
2382 (Instance::setDidExecuteFunction):
2383 (Instance::didExecuteFunction):
2384 (Instance::setValueOfField):
2385 * bindings/runtime.h:
2386 * bindings/testbindings.mm:
2387 (+[MyFirstInterface webScriptNameForSelector:]):
2388 (-[MyFirstInterface callJSObject::]):
2390 2004-05-14 Vicki Murley <vicki@apple.com>
2394 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2396 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2400 2004-05-13 Richard Williamson <rjw@apple.com>
2407 * bindings/objc/WebScriptObject.h:
2409 2004-05-13 Richard Williamson <rjw@apple.com>
2411 Approved API changes. Currently unimplemented.
2416 * JavaScriptCore.pbproj/project.pbxproj:
2417 * bindings/objc/WebScriptObject.h: Added.
2418 * bindings/objc/WebScriptObject.mm: Added.
2419 (+[WebScriptObject throwException:]):
2420 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2421 (-[WebScriptObject evaluateWebScript:]):
2422 (-[WebScriptObject stringRepresentation]):
2423 (+[WebUndefined undefined]):
2424 (-[WebUndefined initWithCoder:]):
2425 (-[WebUndefined encodeWithCoder:]):
2426 (-[WebUndefined copyWithZone:]):
2428 2004-05-07 Vicki Murley <vicki@apple.com>
2432 Turn off GC since it uses ppc only instructions (which breaks
2435 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2439 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2443 - add -funroll-loops=16 compiler option for approx .5% speedup on
2444 HTML iBench and .5-1% speedup on JS iBench.
2446 * JavaScriptCore.pbproj/project.pbxproj:
2448 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2452 Enable full conservative GC mode in addition to test mode. When
2453 conservative GC is enabled, we now get an 11% speed improvement on
2454 the iBench. Also fix some spots I missed before.
2456 Specific noteworth changes:
2458 * kjs/collector.cpp:
2459 (KJS::Collector::markStackObjectsConservatively): Check possible
2460 cell pointers for 8-byte aligment and verify they are not 0.
2462 * kjs/protected_values.cpp:
2463 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2464 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2466 (KJS::gcProtectNullTolerant): ...to here...
2467 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2468 tolerance, and doing the check is expensive.
2470 * kjs/protected_values.cpp:
2471 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2472 that is still very good.
2477 (KJS::ProtectedValue::ProtectedValue):
2478 (KJS::ProtectedValue::~ProtectedValue):
2479 (KJS::ProtectedValue::operator=):
2480 (KJS::ProtectedObject::ProtectedObject):
2481 (KJS::ProtectedObject::~ProtectedObject):
2482 (KJS::ProtectedObject::operator=):
2483 (KJS::ProtectedReference::ProtectedReference):
2484 (KJS::ProtectedReference::~ProtectedReference):
2485 (KJS::ProtectedReference::operator=):
2486 * kjs/protected_values.cpp:
2487 (KJS::ProtectedValues::getProtectCount):
2488 (KJS::ProtectedValues::increaseProtectCount):
2489 (KJS::ProtectedValues::decreaseProtectCount):
2490 (KJS::ProtectedValues::computeHash):
2491 * bindings/runtime_root.cpp:
2492 (KJS::Bindings::addNativeReference):
2493 (KJS::Bindings::removeNativeReference):
2494 (RootObject::removeAllNativeReferences):
2495 * bindings/runtime_root.h:
2496 (KJS::Bindings::RootObject::~RootObject):
2497 (KJS::Bindings::RootObject::setRootObjectImp):
2498 * kjs/collector.cpp:
2499 (KJS::Collector::allocate):
2500 (KJS::Collector::collect):
2503 (NumberImp::create):
2504 (InterpreterImp::globalInit):
2505 (InterpreterImp::globalClear):
2506 (InterpreterImp::mark):
2508 (KJS::List::derefValues):
2509 (KJS::List::refValues):
2510 (KJS::List::append):
2512 (KJS::ObjectImp::setInternalValue):
2513 (KJS::ObjectImp::putDirect):
2518 (KJS::ValueImp::ValueImp):
2519 (KJS::ValueImp::~ValueImp):
2521 (KJS::Value::Value):
2522 (KJS::Value::~Value):
2523 (KJS::Value::operator=):
2525 2004-04-30 Richard Williamson <rjw@apple.com>
2527 Asking an NSInvocation for it's return value when return type
2528 is void throws an exception. Added check for void return types
2529 to avoid this exception.
2533 * bindings/objc/objc_instance.mm:
2534 (ObjcInstance::invokeMethod):
2536 2004-04-29 Richard Williamson <rjw@apple.com>
2538 Fixed several bad problems with the ObjC bindings. In particular, conversion
2539 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2543 * bindings/objc/objc_jsobject.h:
2544 * bindings/objc/objc_jsobject.mm:
2545 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2546 (-[JavaScriptObject KJS::]):
2547 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2548 (-[JavaScriptObject call:arguments:]):
2549 (-[JavaScriptObject evaluate:]):
2550 (-[JavaScriptObject getMember:]):
2551 (-[JavaScriptObject getSlot:]):
2552 * bindings/objc/objc_runtime.mm:
2553 (ObjcField::valueFromInstance):
2554 (ObjcField::setValueToInstance):
2555 * bindings/objc/objc_utility.mm:
2556 (KJS::Bindings::convertValueToObjcValue):
2557 (KJS::Bindings::convertObjcValueToValue):
2558 * bindings/runtime.h:
2559 * bindings/runtime_root.cpp:
2560 (KJS::Bindings::rootForInterpreter):
2561 (KJS::Bindings::addNativeReference):
2562 (KJS::Bindings::removeNativeReference):
2563 * bindings/runtime_root.h:
2564 * bindings/testbindings.mm:
2565 (-[MyFirstInterface logMessage:]):
2566 (-[MyFirstInterface setJSObject:]):
2567 (-[MyFirstInterface callJSObject::]):
2569 2004-04-24 Darin Adler <darin@apple.com>
2573 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2576 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2580 Implementation of conservative GC, based partly on code from
2581 Darin. It's turned off for now, so it shouldn't have any effect on
2584 * JavaScriptCore.pbproj/project.pbxproj:
2585 * kjs/collector.cpp:
2586 (KJS::Collector::markStackObjectsConservatively):
2587 (KJS::Collector::markProtectedObjects):
2588 (KJS::Collector::collect):
2593 * kjs/protected_values.cpp: Added.
2594 (KJS::ProtectedValues::getProtectCount):
2595 (KJS::ProtectedValues::increaseProtectCount):
2596 (KJS::ProtectedValues::insert):
2597 (KJS::ProtectedValues::decreaseProtectCount):
2598 (KJS::ProtectedValues::expand):
2599 (KJS::ProtectedValues::shrink):
2600 (KJS::ProtectedValues::rehash):
2601 (KJS::ProtectedValues::computeHash):
2602 * kjs/protected_values.h: Added.
2604 (ValueImp::useConservativeMark):
2612 2004-04-22 Richard Williamson <rjw@apple.com>
2614 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2617 * bindings/npruntime.h:
2619 2004-04-22 Richard Williamson <rjw@apple.com>
2621 Updated plugin binding API to reflect latest revision from
2624 Biggest change is the introduction of NPVariant used to represent
2625 value types. NPVariant replaces the use of NPObject for the
2626 exchange of values between scripting environment and native code.
2630 * JavaScriptCore.pbproj/project.pbxproj:
2631 * bindings/NP_jsobject.cpp:
2632 (identiferFromNPIdentifier):
2638 (NPN_GetPropertyAtIndex):
2639 (NPN_SetPropertyAtIndex):
2640 * bindings/c/c_class.cpp:
2641 (CClass::methodsNamed):
2642 (CClass::fieldNamed):
2643 * bindings/c/c_instance.cpp:
2644 (CInstance::invokeMethod):
2645 (CInstance::defaultValue):
2646 * bindings/c/c_runtime.cpp:
2647 (CField::valueFromInstance):
2648 (CField::setValueToInstance):
2649 * bindings/c/c_utility.cpp:
2650 (convertNPStringToUTF16):
2651 (convertUTF8ToUTF16):
2652 (coerceValueToNPVariantStringType):
2653 (convertValueToNPVariant):
2654 (convertNPVariantToValue):
2655 * bindings/c/c_utility.h:
2656 * bindings/npruntime.cpp:
2657 (NPN_GetIdentifier):
2658 (NPN_GetIdentifiers):
2659 (NPN_UTF8FromIdentifier):
2660 (NPN_VariantIsVoid):
2661 (NPN_VariantIsNull):
2662 (NPN_VariantIsUndefined):
2663 (NPN_VariantIsBool):
2664 (NPN_VariantIsInt32):
2665 (NPN_VariantIsDouble):
2666 (NPN_VariantIsString):
2667 (NPN_VariantIsObject):
2668 (NPN_VariantToBool):
2669 (NPN_VariantToString):
2670 (NPN_VariantToInt32):
2671 (NPN_VariantToDouble):
2672 (NPN_VariantToObject):
2673 (NPN_InitializeVariantAsVoid):
2674 (NPN_InitializeVariantAsNull):
2675 (NPN_InitializeVariantAsUndefined):
2676 (NPN_InitializeVariantWithBool):
2677 (NPN_InitializeVariantWithInt32):
2678 (NPN_InitializeVariantWithDouble):
2679 (NPN_InitializeVariantWithString):
2680 (NPN_InitializeVariantWithStringCopy):
2681 (NPN_InitializeVariantWithObject):
2682 (NPN_InitializeVariantWithVariant):
2683 (NPN_ReleaseVariantValue):
2686 (NPN_ReleaseObject):
2687 (NPN_IsKindOfClass):
2688 (NPN_SetExceptionWithUTF8):
2690 * bindings/npruntime.h:
2692 (_NPString::_NPVariant::):
2693 * bindings/testbindings.cpp:
2708 2004-04-22 Darin Adler <darin@apple.com>
2712 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2715 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2716 Was resulting in a buffer 2x the needed size.
2717 (KJS::UString::expandPreCapacity): Ditto.
2718 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2720 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2724 Preliminary change for conservative GC. Create "protected"
2725 subclasses to GC-protect objects when on heap, since we will soon
2726 remove the built-in refcounting of the normal wrapper classes. Use
2729 * JavaScriptCore.pbproj/project.pbxproj:
2732 (KJS::InterpreterImp::globalObject):
2733 * kjs/interpreter.h:
2734 * kjs/property_map.cpp:
2736 * kjs/reference_list.cpp:
2738 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2742 Optimize prepend using the shared substring optimization. Also,
2743 limit the applicability of shared append and shared prepend. If
2744 you overdo it, it does more harm than good, because you create a
2745 bunch of strings that are disqualified from future shared
2746 append/prepend, for not much immediate savings in allocate/copy
2751 (KJS::UString::Rep::create):
2752 (KJS::UString::expandedSize):
2753 (KJS::UString::usedPreCapacity):
2754 (KJS::UString::expandCapacity):
2755 (KJS::UString::expandPreCapacity):
2756 (KJS::UString::UString):
2757 (KJS::UString::append):
2758 (KJS::UString::operator=):
2760 (KJS::UString::Rep::data):
2762 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2763 Reviewed by Richard.
2765 No more need for Completion or Reference to privately inherit from
2766 Value, none of the superclass functionality is used.
2773 2004-04-16 Richard Williamson <rjw@apple.com>
2775 Added interpreter lock protection around object creation.
2779 * bindings/runtime.cpp:
2780 (Instance::createRuntimeObject):
2782 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2786 Another JavaScript speed improvement: use the mechanism from
2787 string append optimization to make taking a substring fast, again
2790 A further 22% improvement on the 24fun string speed test.
2794 (KJS::UString::Rep::create):
2795 (KJS::UString::UString):
2796 (KJS::UString::append):
2797 (KJS::UString::operator=):
2798 (KJS::UString::substr):
2800 (KJS::UString::Rep::data):
2802 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2806 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2807 - fixed <rdar://problem/3600691>: Table generation test is really slow
2808 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2810 80% speedup on the string test, lesser speedups on the other two.
2812 Two different optimizations here:
2814 1) Avoid large overhead of scanning strings to see if they are all
2815 ASCII before numeric conversion.
2818 (AssignNode::evaluate): Don't convert to integer until we know for
2819 sure the operation will need it. Attempting to convert strings to
2820 numbers is a waste when they are being appended with +=.
2822 2) Avoid huge cost of appending strings.
2824 This is done by allowing multiple strings to share a buffer but
2825 actually use different ranges of it. The first time a string is
2826 appended to, we start leaving at least 10% extra space in the
2827 buffer, so doing N appends to the same string takes O(log N)
2828 mallocs instead of O(N).
2830 * kjs/identifier.cpp:
2831 (KJS::Identifier::equal):
2832 (KJS::Identifier::add):
2835 (KJS::UCharReference::operator=):
2836 (KJS::UCharReference::ref):
2837 (KJS::UString::Rep::create):
2838 (KJS::UString::Rep::destroy):
2839 (KJS::UString::expandedSize):
2840 (KJS::UString::usedCapacity):
2841 (KJS::UString::expandCapacity):
2842 (KJS::UString::UString):
2843 (KJS::UString::null):
2844 (KJS::UString::append):
2845 (KJS::UString::operator=):
2846 (KJS::UString::toStrictUInt32):
2847 (KJS::UString::detach):
2848 (KJS::KJS::operator==):
2850 (KJS::UString::Rep::data):
2851 (KJS::UString::Rep::hash):
2853 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2857 - fix deployment build by avoiding deployment-only warning.
2859 * kjs/scope_chain.cpp:
2860 (KJS::ScopeChain::bottom):
2862 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2866 Changed things so that newly created objects get a prototype based
2867 on the scope chain of the current function, rather than the
2868 interpreter that started execution. This fixes the following bugs:
2870 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2871 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2873 * JavaScriptCore.pbproj/project.pbxproj:
2874 * kjs/array_object.cpp:
2875 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2876 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2877 (ArrayProtoFuncImp::call):
2878 (ArrayObjectImp::construct):
2879 * kjs/bool_object.cpp:
2880 (BooleanObjectImp::construct):
2881 * kjs/date_object.cpp:
2882 (DateProtoFuncImp::DateProtoFuncImp):
2883 (DateProtoFuncImp::call):
2884 (DateObjectImp::construct):
2885 * kjs/error_object.cpp:
2886 (ErrorObjectImp::construct):
2888 (FunctionImp::FunctionImp):
2889 (FunctionImp::call):
2890 (DeclaredFunctionImp::construct):
2891 (ArgumentsImp::ArgumentsImp):
2892 (GlobalFuncImp::call):
2893 * kjs/function_object.cpp:
2894 (FunctionProtoFuncImp::call):
2895 (FunctionObjectImp::construct):
2897 (BooleanImp::toObject):
2898 (StringImp::toObject):
2899 (NumberImp::toObject):
2900 (InterpreterImp::InterpreterImp):
2901 (InterpreterImp::clear):
2902 (InterpreterImp::interpreterWithGlobalObject):
2904 * kjs/interpreter.cpp:
2905 (ExecState::lexicalInterpreter):
2906 * kjs/interpreter.h:
2907 (KJS::ExecState::dynamicInterpreter):
2908 (KJS::ExecState::interpreter):
2909 * kjs/math_object.cpp:
2910 (MathFuncImp::MathFuncImp):
2912 (StatementNode::hitStatement):
2913 (StatementNode::abortStatement):
2914 (RegExpNode::evaluate):
2915 (ElementNode::evaluate):
2916 (ArrayNode::evaluate):
2917 (ObjectLiteralNode::evaluate):
2918 (PropertyValueNode::evaluate):
2919 (FunctionCallNode::evaluate):
2920 (FuncDeclNode::processFuncDecl):
2921 (FuncExprNode::evaluate):
2922 * kjs/number_object.cpp:
2923 (NumberObjectImp::construct):
2925 (KJS::ObjectImp::defaultValue):
2926 (KJS::Error::create):
2927 * kjs/object_object.cpp:
2928 (ObjectObjectImp::construct):
2929 * kjs/reference.cpp:
2930 (Reference::putValue):
2931 * kjs/regexp_object.cpp:
2932 (RegExpProtoFuncImp::call):
2933 (RegExpObjectImp::arrayOfMatches):
2934 (RegExpObjectImp::construct):
2935 * kjs/scope_chain.cpp:
2936 (KJS::ScopeChain::bottom):
2937 * kjs/scope_chain.h:
2938 * kjs/string_object.cpp:
2939 (StringProtoFuncImp::StringProtoFuncImp):
2940 (StringProtoFuncImp::call):
2941 (StringObjectImp::construct):
2947 2004-03-31 Richard Williamson <rjw@apple.com>
2949 Tedious renames based on feedback from plugin-futures list.
2950 NP_ functions are renamed with NPN_ prefix.
2951 Types prefix renamed from NP_ to NP.
2952 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2954 No review because this was just a renaming patch.
2956 * bindings/NP_jsobject.cpp:
2959 (identiferFromNPIdentifier):
2964 (NPN_RemoveProperty):
2966 (NPN_GetPropertyAtIndex):
2967 (NPN_SetPropertyAtIndex):
2968 * bindings/NP_jsobject.h:
2969 * bindings/c/c_class.cpp:
2970 (CClass::_commonInit):
2971 (CClass::classForIsA):
2973 (CClass::methodsNamed):
2974 (CClass::fieldNamed):
2975 * bindings/c/c_class.h:
2976 * bindings/c/c_instance.cpp:
2977 (CInstance::CInstance):
2978 (CInstance::~CInstance):
2979 (CInstance::operator=):
2980 (CInstance::invokeMethod):
2981 (CInstance::defaultValue):
2982 * bindings/c/c_instance.h:
2983 (KJS::Bindings::CInstance::getObject):
2984 * bindings/c/c_runtime.cpp:
2985 (CField::valueFromInstance):
2986 (CField::setValueToInstance):
2987 * bindings/c/c_runtime.h:
2988 (KJS::Bindings::CField::CField):
2989 (KJS::Bindings::CField::name):
2990 (KJS::Bindings::CMethod::CMethod):
2991 (KJS::Bindings::CMethod::name):
2992 * bindings/c/c_utility.cpp:
2993 (coerceValueToNPString):
2994 (convertValueToNPValueType):
2995 (convertNPValueTypeToValue):
2996 * bindings/c/c_utility.h:
2997 * bindings/npruntime.cpp:
2998 (NPN_IdentifierFromUTF8):
2999 (NPN_IsValidIdentifier):
3000 (NPN_GetIdentifiers):
3001 (NPN_UTF8FromIdentifier):
3004 (NPN_ReleaseObject):
3005 (NPN_IsKindOfClass):
3006 (NPN_SetExceptionWithUTF8):
3009 (NPN_CreateNumberWithInt):
3010 (NPN_CreateNumberWithFloat):
3011 (NPN_CreateNumberWithDouble):
3012 (NPN_IntFromNumber):
3013 (NPN_FloatFromNumber):
3014 (NPN_DoubleFromNumber):
3016 (NPN_CreateStringWithUTF8):
3017 (NPN_CreateStringWithUTF16):
3018 (NPN_DeallocateUTF8):
3019 (NPN_UTF8FromString):
3020 (NPN_UTF16FromString):
3023 (NPN_CreateBoolean):
3024 (NPN_BoolFromBoolean):
3027 (undefinedAllocate):
3033 (NPN_ObjectAtIndex):
3034 * bindings/npruntime.h:
3035 * bindings/runtime.cpp:
3036 (Instance::createBindingForLanguageInstance):
3037 * bindings/testbindings.cpp:
3038 (initializeIdentifiers):
3058 2004-03-31 Richard Williamson <rjw@apple.com>
3060 Changed references to NP_runtime.h to npruntime.h
3062 * JavaScriptCore.pbproj/project.pbxproj:
3063 * bindings/NP_jsobject.h:
3064 * bindings/c/c_class.h:
3065 * bindings/c/c_instance.h:
3066 * bindings/c/c_runtime.h:
3067 * bindings/c/c_utility.h:
3068 * bindings/npruntime.cpp:
3070 2004-03-31 Richard Williamson <rjw@apple.com>
3072 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
3074 * JavaScriptCore.pbproj/project.pbxproj:
3075 * bindings/NP_jsobject.h:
3076 * bindings/npruntime.cpp:
3080 2004-03-23 Richard Williamson <rjw@apple.com>
3082 Added implementation of KJS::Value <-> NP_Object conversion functions.
3083 Augmented test program for 'C' bindings.
3084 Added asserts and parameter checking to all public API.
3088 * JavaScriptCore.pbproj/project.pbxproj:
3089 * bindings/NP_jsobject.cpp:
3091 * bindings/NP_jsobject.h: Added.
3092 * bindings/NP_runtime.cpp:
3093 (NP_IdentifierFromUTF8):
3094 (NP_IsValidIdentifier):
3095 (NP_GetIdentifiers):
3100 (NP_SetExceptionWithUTF8):
3103 (NP_FloatFromNumber):
3104 (NP_DoubleFromNumber):
3105 (NP_CreateStringWithUTF8):
3106 (NP_CreateStringWithUTF16):
3107 (NP_DeallocateUTF8):
3108 (NP_UTF8FromString):
3109 (NP_UTF16FromString):
3111 (NP_BoolFromBoolean):
3112 * bindings/NP_runtime.h:
3113 * bindings/c/c_instance.cpp:
3114 (CInstance::invokeMethod):
3115 * bindings/c/c_utility.cpp:
3116 (coerceValueToNPString):
3117 (convertValueToNPValueType):
3118 (convertNPValueTypeToValue):
3119 * bindings/c/c_utility.h:
3121 * bindings/testC.js: Added.
3122 * bindings/testbindings.cpp:
3132 (myInterfaceInvoke):
3133 (myInterfaceAllocate):
3137 2004-03-19 Darin Adler <darin@apple.com>
3141 - fixed problem with methods like setUTCHour
3143 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
3144 GMT vs. local time function based on the utc flag.
3146 2004-03-17 Richard Williamson <rjw@apple.com>
3148 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
3152 * bindings/NP_jsobject.cpp:
3157 (NP_GetPropertyAtIndex):
3158 * bindings/NP_runtime.h:
3160 2004-03-16 Richard Williamson <rjw@apple.com>
3162 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.
3166 * bindings/jni/jni_class.cpp:
3167 (JavaClass::methodsNamed):
3169 2004-03-15 Richard Williamson <rjw@apple.com>
3171 Fixed 3570854. Don't attempt to convert Null to strings. We
3172 were incorrectly converting to "Null".
3174 Actually fixed by Scott Kovatch.
3176 Reviewed by Richard.
3178 * bindings/jni/jni_utility.cpp:
3179 (KJS::Bindings::convertValueToJValue):
3183 2004-03-11 Richard Williamson <rjw@apple.com>
3185 Stitched together the NP stuff to our language independent
3186 JavaScript binding stuff. Very close to being done.
3188 Added program to test C bindings (and NP stuff). Just tests
3189 properties. Will add methods and JavaScript access, etc.
3191 Updated Makefile.am to account for new bindings/c directory.
3193 Change NP_UTF8 from "const char *" to "char" to allow for
3194 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
3197 Added NP_IsValidIdentifier().
3201 * JavaScriptCore.pbproj/project.pbxproj:
3203 * bindings/NP_jsobject.cpp:
3204 (identiferFromNPIdentifier):
3206 * bindings/NP_runtime.cpp:
3207 (NP_IdentifierFromUTF8):
3208 (NP_IsValidIdentifier):
3209 (NP_GetIdentifiers):
3210 (NP_UTF8FromIdentifier):
3211 (NP_SetExceptionWithUTF8):
3213 (NP_CreateStringWithUTF8):
3214 (NP_CreateStringWithUTF16):
3215 (NP_UTF8FromString):
3216 (NP_UTF16FromString):
3217 * bindings/NP_runtime.h:
3218 * bindings/c/c_class.cpp: Added.
3219 (CClass::_commonDelete):
3220 (CClass::_commonCopy):
3221 (CClass::_commonInit):
3222 (_createClassesByIsAIfNecessary):
3223 (CClass::classForIsA):
3226 (CClass::methodsNamed):
3227 (CClass::fieldNamed):
3228 * bindings/c/c_class.h: Added.
3229 (KJS::Bindings::CClass::~CClass):
3230 (KJS::Bindings::CClass::CClass):
3231 (KJS::Bindings::CClass::operator=):
3232 (KJS::Bindings::CClass::constructorAt):
3233 (KJS::Bindings::CClass::numConstructors):
3234 * bindings/c/c_instance.cpp: Added.
3235 (CInstance::CInstance):
3236 (CInstance::~CInstance):
3237 (CInstance::operator=):
3238 (CInstance::getClass):
3241 (CInstance::invokeMethod):
3242 (CInstance::defaultValue):
3243 (CInstance::stringValue):
3244 (CInstance::numberValue):
3245 (CInstance::booleanValue):
3246 (CInstance::valueOf):
3247 * bindings/c/c_instance.h: Added.
3248 (KJS::Bindings::CInstance::getObject):
3249 * bindings/c/c_runtime.cpp: Added.
3250 (CField::valueFromInstance):
3251 (CField::setValueToInstance):
3252 * bindings/c/c_runtime.h: Added.
3253 (KJS::Bindings::CField::CField):
3254 (KJS::Bindings::CField::name):
3255 (KJS::Bindings::CField::type):
3256 (KJS::Bindings::CMethod::CMethod):
3257 (KJS::Bindings::CMethod::name):
3258 (KJS::Bindings::CMethod::numParameters):
3259 * bindings/c/c_utility.cpp: Added.
3260 (coerceValueToNPValueType):
3261 (convertValueToNPValueType):
3262 (convertNPValueTypeToValue):
3263 * bindings/c/c_utility.h: Added.
3264 * bindings/make_testbindings:
3265 * bindings/runtime.cpp:
3266 (Instance::createBindingForLanguageInstance):
3267 * bindings/runtime.h:
3268 (KJS::Bindings::Instance::):
3269 * bindings/testbindings.cpp: Added.
3270 (initializeIdentifiers):
3271 (myInterfaceHasProperty):
3272 (myInterfaceHasMethod):
3273 (myInterfaceGetProperty):
3274 (myInterfaceSetProperty):
3275 (myInterfaceInvoke):
3276 (myInterfaceAllocate):
3277 (myInterfaceInvalidate):
3278 (myInterfaceDeallocate):
3279 (GlobalImp::className):
3280 (readJavaScriptFromFile):
3283 2004-03-10 Richard Williamson <rjw@apple.com>
3285 Made changes to support new asychronous approach to calls from
3286 plugin to JavaScript
3290 * bindings/NP_jsobject.cpp:
3295 (NP_GetPropertyAtIndex):
3296 * bindings/NP_runtime.h:
3297 * bindings/make_testbindings:
3298 * bindings/runtime.cpp:
3299 (Instance::createBindingForLanguageInstance):
3301 2004-03-10 Richard Williamson <rjw@apple.com>
3303 Updated header to include proposed changes from
3304 plugin-futures list. Calls from plugin to JavaScript
3305 are now asynchronous.
3309 * bindings/NP_runtime.h:
3313 2004-03-04 Richard Williamson <rjw@apple.com>
3315 Implementation of NP_JavaScriptObject. This is the 'C' class
3316 that wraps a JavaScript object.
3320 * JavaScriptCore.pbproj/project.pbxproj:
3321 * bindings/NP_jsobject.cpp: Added.
3322 (coerceValueToNPValueType):
3323 (convertValueToNPValueType):
3324 (convertNPValueTypeToValue):
3328 (identiferFromNPIdentifier):
3333 (NP_RemoveProperty):
3335 (NP_GetPropertyAtIndex):
3336 (NP_SetPropertyAtIndex):
3337 * bindings/NP_runtime.cpp:
3339 * bindings/NP_runtime.h:
3340 * bindings/runtime_object.h:
3342 2004-03-04 Richard Williamson <rjw@apple.com>
3344 Added NP_Array implementation.
3346 Changed NP_Boolean to just depend on two static instances, no
3347 space is required for values.
3351 * bindings/NP_runtime.cpp:
3353 (NP_BoolFromBoolean):
3359 * bindings/NP_runtime.h:
3361 2004-03-03 Darin Adler <darin@apple.com>
3365 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3366 copyright string, and that's all that was in here.
3367 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3369 2004-03-03 Richard Williamson <rjw@apple.com>
3371 More 'C' binding implementation. Fleshed out all the
3372 'primitive' data types.
3376 * bindings/NP_runtime.cpp:
3381 (NP_CreateStringWithUTF8):
3382 (NP_CreateStringWithUTF16):
3383 (NP_UTF8FromString):
3384 (NP_UTF16FromString):
3387 (booleanDeallocate):
3389 (NP_BoolFromBoolean):
3393 (undefinedAllocate):
3394 (undefinedDeallocate):
3396 * bindings/NP_runtime.h:
3398 2004-03-03 Richard Williamson <rjw@apple.com>
3400 More 'C' binding implementation.
3404 * bindings/NP_runtime.cpp:
3407 (getIdentifierDictionary):
3408 (NP_IdentifierFromUTF8):
3409 (NP_UTF8FromIdentifier):
3414 (NP_CreateNumberWithInt):
3415 (NP_CreateNumberWithFloat):
3416 (NP_CreateNumberWithDouble):
3418 (NP_FloatFromNumber):
3419 (NP_DoubleFromNumber):
3420 * bindings/NP_runtime.h:
3422 2004-03-02 Richard Williamson <rjw@apple.com>
3424 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3425 own customer retain/release scheme.
3429 * bindings/NP_runtime.cpp:
3432 * bindings/NP_runtime.h:
3434 2004-03-02 Richard Williamson <rjw@apple.com>
3436 C binding API. Partial implementation.
3438 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.
3440 Factored root object reference counting scheme. It is now useful independent
3445 * JavaScriptCore.pbproj/project.pbxproj:
3446 * bindings/NP_runtime.cpp: Added.
3447 (NP_IdentifierFromUTF8):
3448 (NP_GetIdentifiers):
3449 (NP_UTF8FromIdentifier):
3459 (NP_RemoveProperty):
3461 (NP_GetPropertyAtIndex):
3462 (NP_SetPropertyAtIndex):
3463 (NP_CreateNumberWithInt):
3464 (NP_CreateNumberWithFloat):
3465 (NP_CreateNumberWithDouble):
3467 (NP_FloatFromNumber):
3468 (NP_DoubleFromNumber):
3469 (NP_CreateStringWithUTF8):
3470 (NP_CreateStringWithUTF16):
3471 (NP_UTF8FromString):
3472 (NP_UTF16FromString):
3474 (NP_BoolFromBoolean):
3480 * bindings/NP_runtime.h: Added.
3481 * bindings/jni/jni_jsobject.cpp:
3483 (JSObject::finalize):
3484 (JSObject::createNative):
3485 (JSObject::convertValueToJObject):
3486 * bindings/jni/jni_jsobject.h:
3487 * bindings/objc/objc_jsobject.h:
3488 * bindings/objc/objc_jsobject.mm:
3490 (windowJavaScriptObject):
3491 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3492 (-[JavaScriptObject dealloc]):
3493 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3494 (-[JavaScriptObject call:arguments:]):
3495 (-[JavaScriptObject evaluate:]):
3496 (-[JavaScriptObject getMember:]):
3497 (-[JavaScriptObject setMember:value:]):
3498 (-[JavaScriptObject removeMember:]):
3499 (-[JavaScriptObject toString]):
3500 (-[JavaScriptObject getSlot:]):
3501 (-[JavaScriptObject setSlot:value:]):
3502 * bindings/objc/objc_utility.h:
3503 * bindings/objc/objc_utility.mm:
3504 (KJS::Bindings::convertValueToObjcValue):
3505 * bindings/runtime_root.cpp: Added.
3506 (getReferencesByRootDictionary):
3507 (getReferencesDictionary):
3508 (KJS::Bindings::findReferenceDictionary):
3509 (KJS::Bindings::rootForImp):
3510 (KJS::Bindings::addNativeReference):
3511 (KJS::Bindings::removeNativeReference):
3512 (completedJavaScriptAccess):
3513 (initializeJavaScriptAccessLock):
3514 (lockJavaScriptAccess):
3515 (unlockJavaScriptAccess):
3516 (RootObject::dispatchToJavaScriptThread):
3517 (performJavaScriptAccess):
3518 (RootObject::setFindRootObjectForNativeHandleFunction):
3519 (RootObject::removeAllNativeReferences):
3520 * bindings/runtime_root.h: Added.
3521 (KJS::Bindings::RootObject::RootObject):
3522 (KJS::Bindings::RootObject::~RootObject):
3523 (KJS::Bindings::RootObject::setRootObjectImp):
3524 (KJS::Bindings::RootObject::rootObjectImp):
3525 (KJS::Bindings::RootObject::setInterpreter):
3526 (KJS::Bindings::RootObject::interpreter):
3527 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3528 (KJS::Bindings::RootObject::runLoop):
3529 (KJS::Bindings::RootObject::performJavaScriptSource):
3535 2004-02-18 Richard Williamson <rjw@apple.com>
3537 Added NSNumber/Number conversion.
3539 Removed some unnecessary KJS:: namespace specifiers.
3543 * bindings/objc/objc_utility.mm:
3544 (KJS::Bindings::convertValueToObjcValue):
3545 (KJS::Bindings::convertObjcValueToValue):
3546 * bindings/runtime_array.h:
3548 2004-02-18 Richard Williamson <rjw@apple.com>
3550 Added support for export NSArrays.
3552 Updated valueAt() to take an ExecState so we can throw
3555 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
3556 ObjectiveC classes to control the visibility of their methods in
3561 * bindings/jni/jni_runtime.cpp:
3562 (JavaField::valueFromInstance):
3563 (JavaArray::valueAt):
3564 * bindings/jni/jni_runtime.h:
3565 * bindings/objc/objc_class.mm:
3566 (ObjcClass::methodsNamed):
3567 * bindings/objc/objc_runtime.h:
3568 (KJS::Bindings::ObjcArray::getObjcArray):
3569 * bindings/objc/objc_runtime.mm:
3570 (ObjcField::valueFromInstance):
3571 (ObjcField::setValueToInstance):
3572 (ObjcArray::ObjcArray):
3573 (ObjcArray::~ObjcArray):
3574 (ObjcArray::operator=):
3575 (ObjcArray::setValueAt):
3576 (ObjcArray::valueAt):
3577 (ObjcArray::getLength):
3578 * bindings/objc/objc_utility.mm:
3579 (KJS::Bindings::convertValueToObjcValue):
3580 (KJS::Bindings::convertObjcValueToValue):
3581 * bindings/runtime.cpp:
3582 (Instance::getValueOfField):
3583 * bindings/runtime.h:
3584 * bindings/runtime_array.cpp:
3585 (RuntimeArrayImp::get):
3586 * bindings/runtime_object.cpp:
3587 (RuntimeObjectImp::get):
3589 2004-02-17 Richard Williamson <rjw@apple.com>
3591 Added String <-> NSString conversion.
3592 Added tests of String <-> NSString conversion to test program.
3596 * bindings/objc/objc_utility.mm:
3597 (KJS::Bindings::convertValueToObjcValue):
3598 (KJS::Bindings::convertObjcValueToValue):
3600 * bindings/testbindings.mm:
3601 (-[MyFirstInterface getString]):
3603 2004-02-15 Darin Adler <darin@apple.com>
3607 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3608 and removing redundant settings of things that match defaults in other build styles.
3610 2004-02-13 Richard Williamson <rjw@apple.com>
3612 Work towards the JavaScript ObjC bindings. The bindings now work for
3613 simple scalar types. testbindings.mm is an illustration of how the
3618 * JavaScriptCore.pbproj/project.pbxproj:
3620 * bindings/jni/jni_class.cpp:
3621 (JavaClass::methodsNamed):
3622 * bindings/jni/jni_class.h:
3623 * bindings/jni/jni_instance.cpp:
3624 (JavaInstance::invokeMethod):
3625 * bindings/jni/jni_instance.h:
3626 * bindings/jni/jni_runtime.h:
3627 (KJS::Bindings::JavaMethod::returnType):
3628 * bindings/make_testbindings: Added.
3629 * bindings/objc/objc_class.h: Added.
3630 (KJS::Bindings::ObjcClass::~ObjcClass):
3631 (KJS::Bindings::ObjcClass::ObjcClass):
3632 (KJS::Bindings::ObjcClass::operator=):
3633 (KJS::Bindings::ObjcClass::constructorAt):
3634 (KJS::Bindings::ObjcClass::numConstructors):
3635 * bindings/objc/objc_class.mm: Added.
3636 (ObjcClass::_commonDelete):
3637 (ObjcClass::_commonCopy):
3638 (ObjcClass::_commonInit):
3639 (_createClassesByIsAIfNecessary):
3640 (ObjcClass::classForIsA):
3641 (ObjcClass::ObjcClass):
3643 (ObjcClass::methodsNamed):
3644 (ObjcClass::fieldNamed):
3645 * bindings/objc/objc_header.h: Added.
3646 * bindings/objc/objc_instance.h: Added.
3647 (KJS::Bindings::ObjcInstance::getObject):
3648 * bindings/objc/objc_instance.mm: Added.
3649 (ObjcInstance::ObjcInstance):
3650 (ObjcInstance::~ObjcInstance):
3651 (ObjcInstance::operator=):
3652 (ObjcInstance::begin):
3653 (ObjcInstance::end):
3654 (ObjcInstance::getClass):
3655 (ObjcInstance::invokeMethod):
3656 (ObjcInstance::defaultValue):
3657 (ObjcInstance::stringValue):
3658 (ObjcInstance::numberValue):
3659 (ObjcInstance::booleanValue):
3660 (ObjcInstance::valueOf):
3661 * bindings/objc/objc_jsobject.h: Added.
3662 * bindings/objc/objc_jsobject.mm: Added.
3663 * bindings/objc/objc_runtime.h:
3664 (KJS::Bindings::ObjcField::~ObjcField):
3665 (KJS::Bindings::ObjcField::ObjcField):
3666 (KJS::Bindings::ObjcField::operator=):
3667 (KJS::Bindings::ObjcMethod::ObjcMethod):
3668 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3669 (KJS::Bindings::ObjcMethod::operator=):
3670 * bindings/objc/objc_runtime.mm: Added.
3671 (ObjcMethod::ObjcMethod):
3673 (ObjcMethod::numParameters):
3674 (ObjcMethod::getMethodSignature):
3675 (ObjcField::ObjcField):
3678 (ObjcField::valueFromInstance):
3679 (ObjcField::setValueToInstance):
3680 * bindings/objc/objc_utility.h: Added.
3682 * bindings/objc/objc_utility.mm: Added.
3683 (KJS::Bindings::JSMethodNameToObjCMethodName):
3684 (KJS::Bindings::convertValueToObjcValue):
3685 (KJS::Bindings::convertObjcValueToValue):
3686 (KJS::Bindings::objcValueTypeForType):
3687 * bindings/runtime.cpp:
3688 (MethodList::MethodList):
3689 (MethodList::operator=):
3690 (Instance::setValueOfField):
3691 (Instance::createBindingForLanguageInstance):
3692 (Instance::createRuntimeObject):
3693 * bindings/runtime.h:
3694 * bindings/runtime_method.cpp:
3695 (RuntimeMethodImp::RuntimeMethodImp):
3696 (RuntimeMethodImp::get):
3697 (RuntimeMethodImp::call):
3698 * bindings/runtime_method.h:
3699 * bindings/runtime_object.cpp:
3700 (RuntimeObjectImp::get):
3701 (RuntimeObjectImp::hasProperty):
3702 * bindings/test.js: Added.
3703 * bindings/testbindings.mm: Added.
3704 (-[MySecondInterface init]):
3705 (-[MyFirstInterface init]):
3706 (-[MyFirstInterface dealloc]):
3707 (+[MyFirstInterface JavaScriptNameForSelector:]):
3708 (-[MyFirstInterface getInt]):
3709 (-[MyFirstInterface setInt:]):
3710 (-[MyFirstInterface getMySecondInterface]):
3711 (-[MyFirstInterface logMessage:]):
3712 (GlobalImp::className):
3713 (readJavaScriptFromFile):
3718 2004-02-08 Darin Adler <darin@apple.com>
3722 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3724 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3725 macros from working right in C++ code that uses the <cctype> header.
3728 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3729 (KJS::UTF8SequenceLengthNonASCII): Added.
3730 (KJS::inlineUTF8SequenceLength): Added.
3731 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3732 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3733 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3734 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3735 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3737 - fixed the test program so it won't hit the interpreter lock assertion
3739 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3743 2004-02-06 Richard Williamson <rjw@apple.com>
3745 Fixed 3550242 and 3546977. The first diff prevents an assert from firing. The second diff prevents a JavaScript exception, caused be an invalid conversion, which has a downstream consequence of preventing a valid conversion.
3749 * bindings/jni/jni_jsobject.cpp:
3750 (JSObject::toString):
3751 * bindings/jni/jni_utility.cpp:
3752 (KJS::Bindings::convertValueToJValue):
3754 2004-02-02 Darin Adler <darin@apple.com>
3758 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3760 * kjs/array_object.cpp:
3761 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3762 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3763 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3764 number is out of range. This prevents new Array(-1) from causing trouble.
3766 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3768 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3769 casting to int. Results now match those in other browsers.
3771 2004-02-02 Darin Adler <darin@apple.com>
3775 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3776 - fixed other related overflow issues
3778 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3780 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3781 must not restrict values to the range of a particular integer type.
3782 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3783 proper handling for negative results from fmod.
3784 (ValueImp::toUInt32): Ditto.
3785 (ValueImp::toUInt16): Ditto.
3786 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3788 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3789 out-of-integer-range values better in the slice function.
3790 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3791 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3792 out-of-integer-range values better in the toString function.
3793 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3794 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3795 and substr functions.
3799 2004-01-30 Richard Williamson <rjw@apple.com>
3801 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3805 * bindings/jni/jni_instance.cpp:
3806 (JavaInstance::stringValue):
3808 2004-01-26 Darin Adler <darin@apple.com>
3810 * Makefile.am: Switch from pbxbuild to xcodebuild.
3812 2004-01-22 Richard Williamson <rjw@apple.com>
3814 Added stubs for ObjC language binding to JavaScript.
3816 * JavaScriptCore.pbproj/project.pbxproj:
3817 * bindings/jni/jni_runtime.h:
3818 * bindings/objc/objc_runtime.h: Added.
3819 (KJS::Bindings::ObjcParameter::ObjcParameter):
3820 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3821 (KJS::Bindings::ObjcParameter::operator=):
3822 (KJS::Bindings::ObjcParameter::type):
3823 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3824 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3825 (KJS::Bindings::ObjcConstructor::_commonCopy):
3826 (KJS::Bindings::ObjcConstructor::operator=):
3827 (KJS::Bindings::ObjcConstructor::value):
3828 (KJS::Bindings::ObjcConstructor::parameterAt):
3829 (KJS::Bindings::ObjcConstructor::numParameters):
3830 (KJS::Bindings::ObjcField::ObjcField):
3831 (KJS::Bindings::ObjcField::~ObjcField):
3832 * bindings/runtime.h:
3834 2004-01-22 Richard Williamson <rjw@apple.com>
3836 Simplified JavaString by using UString as backing store. This
3837 revealed a bug in CString's assignment operator which I fixed.
3839 Removed some dead code.
3843 * bindings/jni/jni_runtime.h:
3844 (KJS::Bindings::JavaString::JavaString):
3845 (KJS::Bindings::JavaString::_commonInit):
3846 (KJS::Bindings::JavaString::UTF8String):
3847 (KJS::Bindings::JavaString::uchars):
3848 (KJS::Bindings::JavaString::length):
3849 (KJS::Bindings::JavaString::ustring):
3850 * bindings/runtime_object.cpp:
3851 (RuntimeObjectImp::RuntimeObjectImp):
3852 * bindings/runtime_object.h:
3854 (KJS::CString::CString):
3855 (KJS::CString::operator=):
3861 2004-01-16 Richard Williamson <rjw@apple.com>
3863 Fixed 3525853. We weren't handling mapping to overloaded Java
3864 methods very well. Even though this is undefined the other
3865 browsers support it. Also fixed a bug with returning arrays
3866 from Java functions.
3870 * bindings/jni/jni_class.cpp:
3871 (JavaClass::_commonInit):
3872 (JavaClass::methodsNamed):
3873 * bindings/jni/jni_class.h:
3874 * bindings/jni/jni_instance.cpp:
3875 (JavaInstance::invokeMethod):
3876 * bindings/jni/jni_instance.h:
3877 * bindings/jni/jni_runtime.cpp:
3878 (JavaArray::convertJObjectToArray):
3879 (JavaField::valueFromInstance):
3880 (JavaMethod::signature):
3881 (JavaArray::valueAt):
3882 * bindings/jni/jni_runtime.h:
3883 * bindings/jni_jsobject.cpp:
3885 (JSObject::convertJObjectToValue):
3886 * bindings/runtime.cpp:
3887 (MethodList::addMethod):
3888 (MethodList::length):
3889 (MethodList::methodAt):
3890 (MethodList::~MethodList):
3891 * bindings/runtime.h:
3892 (KJS::Bindings::MethodList::MethodList):
3893 * bindings/runtime_method.cpp:
3894 (RuntimeMethodImp::RuntimeMethodImp):
3895 (RuntimeMethodImp::get):
3896 (RuntimeMethodImp::call):
3897 * bindings/runtime_method.h:
3898 * bindings/runtime_object.cpp:
3899 (RuntimeObjectImp::get):
3900 (RuntimeObjectImp::hasProperty):
3902 2004-01-16 Richard Williamson <rjw@apple.com>
3904 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3905 protection implemented for 3530401.
3909 * bindings/runtime_method.cpp:
3910 (RuntimeMethodImp::call):
3912 2004-01-15 Richard Williamson <rjw@apple.com>
3914 Fixed 3530401. JNI doesn't cleanup local refs created on the
3915 main thread. IMO this is a bad bug in our JMI implementation.
3917 To work-around the problem I explicitly delete all local refs.
3918 Further, I've added Push/PopLocalFrame calls to catch any refs
3919 that I may have missed. This will guarantee that we don't leak
3920 any Java references.
3924 * bindings/jni/jni_class.cpp:
3925 (JavaClass::_commonInit):
3926 (JavaClass::JavaClass):
3927 * bindings/jni/jni_instance.cpp:
3928 (JavaInstance::begin):
3929 (JavaInstance::end):
3930 * bindings/jni/jni_instance.h:
3931 * bindings/jni/jni_runtime.cpp:
3932 (JavaConstructor::JavaConstructor):
3933 (JavaMethod::JavaMethod):
3934 * bindings/jni_jsobject.cpp:
3935 (JSObject::listFromJArray):
3936 * bindings/runtime.h:
3937 (KJS::Bindings::Instance::begin):
3938 (KJS::Bindings::Instance::end):
3939 * bindings/runtime_object.cpp:
3940 (RuntimeObjectImp::get):
3941 (RuntimeObjectImp::put):
3942 (RuntimeObjectImp::canPut):
3943 (RuntimeObjectImp::hasProperty):
3944 (RuntimeObjectImp::defaultValue):
3946 2004-01-15 Vicki Murley <vicki@apple.com>
3950 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3952 2004-01-14 Richard Williamson <rjw@apple.com>
3954 Fixed 3529466. With recent changes to Java plugin we must no
3955 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3959 * bindings/jni/jni_instance.cpp:
3960 (JObjectWrapper::JObjectWrapper):
3964 2004-01-14 Richard Williamson <rjw@apple.com>
3968 Finalize may be called on an JSObject after we've already remove all our references. The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about. The fix is to check in finalize that we're getting a call on an instance that we still care about.
3972 * bindings/jni_jsobject.cpp:
3974 (removeJavaReference):
3975 (RootObject::removeAllJavaReferencesForRoot):
3978 2004-01-13 Richard Williamson <rjw@apple.com>
3982 The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable. It is set and retained once and should not be released. Unfortunately is it being released when the 'root' object on a LiveConnect applet is released. This has the symptom of eventually causing an deallocation of the main run loop! Usually after about 5 instantiations/destructions of a LiveConnect applet. The CFRelease of the run loop was removed.
3986 * bindings/jni_jsobject.h:
3987 (KJS::Bindings::RootObject::~RootObject):
3993 2004-01-06 Richard Williamson <rjw@apple.com>
3995 Fixed 3521814. Finalize messages weren't being dispatched!
3999 * bindings/jni_jsobject.cpp:
4002 2004-01-05 Richard Williamson <rjw@apple.com>
4004 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
4005 described by 3515579.
4007 Also cleanup up logging of Java exceptions.
4011 * bindings/jni/jni_class.cpp:
4012 (JavaClass::classForInstance):
4013 * bindings/jni/jni_instance.cpp:
4014 (JavaInstance::JavaInstance):
4015 (JavaInstance::getClass):
4016 (JavaInstance::invokeMethod):
4017 (JObjectWrapper::JObjectWrapper):
4018 (JObjectWrapper::~JObjectWrapper):
4019 * bindings/jni/jni_instance.h:
4020 (KJS::Bindings::JavaInstance::operator=):
4021 * bindings/jni/jni_runtime.cpp:
4022 (JavaMethod::JavaMethod):
4023 (JavaMethod::methodID):
4024 * bindings/jni/jni_runtime.h:
4025 (KJS::Bindings::JavaMethod::JavaMethod):
4026 * bindings/jni/jni_utility.cpp:
4030 (KJS::Bindings::getMethodID):
4031 (KJS::Bindings::callJNIVoidMethodIDA):
4032 (KJS::Bindings::callJNIObjectMethodIDA):
4033 (KJS::Bindings::callJNIByteMethodIDA):
4034 (KJS::Bindings::callJNICharMethodIDA):
4035 (KJS::Bindings::callJNIShortMethodIDA):
4036 (KJS::Bindings::callJNIIntMethodIDA):
4037 (KJS::Bindings::callJNILongMethodIDA):
4038 (KJS::Bindings::callJNIFloatMethodIDA):
4039 (KJS::Bindings::callJNIDoubleMethodIDA):
4040 (KJS::Bindings::callJNIBooleanMethodIDA):
4041 (KJS::Bindings::getCharactersFromJStringInEnv):
4042 (KJS::Bindings::getUCharactersFromJStringInEnv):
4043 (KJS::Bindings::getJNIField):
4044 * bindings/jni/jni_utility.h:
4046 l2003-12-23 John Sullivan <sullivan@apple.com>
4048 * JavaScriptCore.pbproj/project.pbxproj:
4049 Xcode version wars, harmless
4051 2003-12-23 Darin Adler <darin@apple.com>
4053 Reviewed by John (concept, not code, which is just the old code coming back).
4055 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
4057 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
4058 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
4060 2003-12-19 Richard Williamson <rjw@apple.com>
4062 Fixed 3515597. When an error occurs we need
4063 to make sure result values are zeroed.
4065 Cleaned up logs by adding a newline.
4069 * bindings/jni/jni_utility.cpp:
4070 (KJS::Bindings::getJavaVM):
4071 (KJS::Bindings::getJNIEnv):
4074 (KJS::Bindings::getJNIField):
4075 * bindings/jni_jsobject.cpp:
4076 (JSObject::convertValueToJObject):
4080 2003-12-17 Richard Williamson <rjw@apple.com>
4082 Ensure that all the symbols we export are in the KJS
4083 namespace (3512245).
4085 Also renamed JavaString.characters() to JavaString.UTF8String()
4086 for enhanced clarity.
4088 Added some sanity checking to constructor of JObjectWrapper.
4093 * bindings/jni/jni_class.cpp:
4094 * bindings/jni/jni_class.h:
4095 * bindings/jni/jni_instance.cpp:
4096 (JavaInstance::invokeMethod):
4097 (JObjectWrapper::JObjectWrapper):
4098 * bindings/jni/jni_instance.h:
4099 * bindings/jni/jni_runtime.cpp:
4100 (JavaParameter::JavaParameter):
4101 (JavaField::JavaField):
4102 (JavaMethod::JavaMethod):
4103 (JavaMethod::signature):
4104 * bindings/jni/jni_runtime.h:
4105 (KJS::Bindings::JavaString::ascii):
4106 (KJS::Bindings::JavaString::UTF8String):
4107 (KJS::Bindings::JavaString::JavaString):
4108 (KJS::Bindings::JavaString::_commonInit):
4109 (KJS::Bindings::JavaString::uchars):
4110 (KJS::Bindings::JavaString::length):
4111 (KJS::Bindings::JavaString::ustring):
4112 (KJS::Bindings::JavaParameter::type):
4113 (KJS::Bindings::JavaField::name):
4114 (KJS::Bindings::JavaField::type):
4115 (KJS::Bindings::JavaMethod::name):
4116 (KJS::Bindings::JavaMethod::returnType):
4117 * bindings/jni/jni_utility.cpp:
4118 (KJS::Bindings::getJavaVM):
4119 (KJS::Bindings::getJNIEnv):
4120 (KJS::Bindings::callJNIVoidMethod):
4121 (KJS::Bindings::callJNIObjectMethod):
4122 (KJS::Bindings::callJNIBooleanMethod):
4123 (KJS::Bindings::callJNIByteMethod):
4124 (KJS::Bindings::callJNICharMethod):
4125 (KJS::Bindings::callJNIShortMethod):
4126 (KJS::Bindings::callJNIIntMethod):
4127 (KJS::Bindings::callJNILongMethod):
4128 (KJS::Bindings::callJNIFloatMethod):
4129 (KJS::Bindings::callJNIDoubleMethod):
4130 (KJS::Bindings::callJNIVoidMethodA):
4131 (KJS::Bindings::callJNIObjectMethodA):
4132 (KJS::Bindings::callJNIByteMethodA):
4133 (KJS::Bindings::callJNICharMethodA):
4134 (KJS::Bindings::callJNIShortMethodA):
4135 (KJS::Bindings::callJNIIntMethodA):
4136 (KJS::Bindings::callJNILongMethodA):
4137 (KJS::Bindings::callJNIFloatMethodA):
4138 (KJS::Bindings::callJNIDoubleMethodA):
4139 (KJS::Bindings::callJNIBooleanMethodA):
4140 (KJS::Bindings::getCharactersFromJString):
4141 (KJS::Bindings::releaseCharactersForJString):
4142 (KJS::Bindings::getCharactersFromJStringInEnv):
4143 (KJS::Bindings::releaseCharactersForJStringInEnv):
4144 (KJS::Bindings::getUCharactersFromJStringInEnv):
4145 (KJS::Bindings::releaseUCharactersForJStringInEnv):
4146 (KJS::Bindings::JNITypeFromClassName):
4147 (KJS::Bindings::signatureFromPrimitiveType):
4148 (KJS::Bindings::JNITypeFromPrimitiveType):
4149 (KJS::Bindings::getJNIField):
4150 (KJS::Bindings::convertValueToJValue):
4151 * bindings/jni/jni_utility.h:
4152 * bindings/jni_jsobject.cpp:
4153 (KJS::Bindings::JSObject::invoke):
4154 (KJS::Bindings::JSObject::JSObject):
4155 (KJS::Bindings::JSObject::call):
4156 (KJS::Bindings::JSObject::eval):
4157 (KJS::Bindings::JSObject::getMember):
4158 (KJS::Bindings::JSObject::setMember):
4159 (KJS::Bindings::JSObject::removeMember):
4160 (KJS::Bindings::JSObject::getSlot):
4161 (KJS::Bindings::JSObject::setSlot):
4162 (KJS::Bindings::JSObject::toString):
4163 (KJS::Bindings::JSObject::finalize):
4164 (KJS::Bindings::JSObject::createNative):
4165 (KJS::Bindings::JSObject::convertValueToJObject):
4166 (KJS::Bindings::JSObject::convertJObjectToValue):
4167 (KJS::Bindings::JSObject::listFromJArray):
4168 * bindings/jni_jsobject.h:
4169 * bindings/runtime.cpp:
4170 * bindings/runtime.h:
4171 * bindings/runtime_method.cpp:
4172 * bindings/runtime_method.h:
4176 2003-12-16 Richard Williamson <rjw@apple.com>
4178 Ack! More assertions. Lock ALL entry points into the interpreter!
4183 * bindings/jni_jsobject.cpp:
4184 (Bindings::JSObject::call):
4185 (Bindings::JSObject::eval):