1 2005-04-26 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
7 * kjs/string_object.cpp:
8 (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
10 2005-04-22 Darin Adler <darin@apple.com>
14 * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
16 2005-04-22 Darin Adler <darin@apple.com>
20 - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
22 * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
23 Not sure why we missed this one earlier.
25 * kjs/grammar.cpp: Regenerated.
27 === JavaScriptCore-412.1 ===
29 2005-04-20 Darin Adler <darin@apple.com>
33 - speedups, total 12% on JavaScript iBench
35 I ran the benchmark under Shark and followed its advice a lot, mainly.
38 (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
39 Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
40 have to bump it each time we call allocate. Put numLiveObjects into a local variable to
41 cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
42 than a pointer so we don't need a special case for NULL. Allow freeList to point to some
43 bogus item when the entire block is full rather than going out of our way to make it
45 (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
46 the loop to avoid re-loading them over and over again.
47 (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
48 variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
49 into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
50 rather than numAllocationsSinceLastCollect.
51 (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
52 the loop to avoid re-loading them over and over again.
53 (KJS::Collector::rootObjectClasses): Ditto.
55 * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
56 directly, avoiding the conversion from Number to Value.
58 * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
59 the thing is an object and we don't want to do all the extra work; just cast directly.
61 * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
62 a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
64 * kjs/lookup.cpp: (keysMatch): Marked this inline.
66 * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
67 (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
69 (NumberNode::evaluate): Ditto.
70 (StringNode::evaluate): Ditto.
71 (ArrayNode::evaluate): Ditto.
72 (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
73 Also just use a pointer for func, rather than an Object.
74 (PostfixNode::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 (DeleteNode::evaluate): Make a Value directly.
78 (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
79 (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
80 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
82 (UnaryPlusNode::evaluate): Make a Value directly.
83 (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
84 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
86 (BitwiseNotNode::evaluate): Make a Value directly.
87 (LogicalNotNode::evaluate): Ditto.
88 (ShiftNode::evaluate): Don't convert to a double before making a Value.
89 (RelationalNode::evaluate): Make a Value directly.
90 (EqualNode::evaluate): Ditto.
91 (BitOperNode::evaluate): Ditto.
92 (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
93 boolean in, often avoiding a conversion from floating point to integer and back.
94 (VarDeclNode::evaluate): Make a Value directly.
95 (ForNode::execute): Remove unused local variable.
98 (KJS::isNaN): Inlined.
100 (KJS::isPosInf): Ditto.
101 (KJS::isNegInf): Ditto.
103 * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
104 (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
105 (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
106 (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
107 boolean in, often avoiding a conversion from floating point to integer and back.
110 * kjs/property_map.cpp:
111 (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
112 re-getting them inside the loop.
113 (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
114 look at the value pointer in the mark function.
115 (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
116 re-getting them inside the loop.
117 (KJS::PropertyMap::put): Ditto.
118 (KJS::PropertyMap::insert): Ditto.
119 (KJS::PropertyMap::remove): Ditto.
120 (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
121 re-getting them inside the loop. Don't bother checking key for 0, since we already have
122 to check value for 0. (Also had to change clear() to set value to 0.)
123 (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
124 loop to avoid re-getting them inside the loop.
125 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
126 (KJS::PropertyMap::save): Ditto.
130 * kjs/protected_values.h: Remove unneeded class name qualifiers.
133 (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
134 (KJS::Reference::Reference): Inlined.
136 (KJS::Reference::getValue): Rewrite to not use getBase.
137 (KJS::Reference::putValue): Ditto.
138 (KJS::Reference::deleteValue): Dittol
140 * kjs/simple_number.h:
141 (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
143 * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
144 to double in various cases that involve integers.
147 (KJS::UString::attach): Inlined.
148 (KJS::UString::release): Inlined.
150 (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
153 (Value::Value): Added overloads for all the various specific types of values, so you don't have
154 to convert from, say, Number to Value, just to create one.
155 (Number::Number): Added an overload that takes a boolean to indicate the number is already
156 known to be an integer.
158 * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
159 a boolean to indicate if the number is known to be an integer (because it was a "simple number").
160 (KJS::ValueImp::marked): Inlined.
161 (KJS::ValueImp::dispatchType): Inlined.
162 (KJS::ValueImp::dispatchToPrimitive): Inlined.
163 (KJS::ValueImp::dispatchToBoolean): Inlined.
164 (KJS::ValueImp::dispatchToNumber): Inlined.
165 (KJS::ValueImp::dispatchToString): Inlined.
166 (KJS::ValueImp::dispatchToUInt32): Inlined.
168 2005-04-14 Maciej Stachowiak <mjs@apple.com>
170 - make fast_malloc.h a private header, not project
172 * JavaScriptCore.pbproj/project.pbxproj:
174 2005-04-12 Maciej Stachowiak <mjs@apple.com>
178 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
180 - use custom single-threaded malloc for all non-GC JavaScriptCore
181 allocations, for a 9.1% speedup on JavaScript iBench
183 * JavaScriptCore.pbproj/project.pbxproj:
185 (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
186 (KJS::Collector::collect): And dlfree to free it.
187 * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
188 * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
189 macro to give a class custom operator new/delete
190 * kjs/identifier.cpp:
191 (KJS::Identifier::add): Use dlmalloc/dlfree.
192 * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
193 * kjs/property_map.cpp:
194 (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
195 (KJS::PropertyMap::rehash): ditto
198 (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
199 buffer, to hide allocation details from webcore.
200 (KJS::UString::UString): use createCopying when appropriate.
201 (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
202 (KJS::UString::expandedSize): likewise
203 (KJS::UString::expandCapacity): likewise
204 (KJS::UString::expandPreCapacity): likewise
205 (KJS::UString::spliceSubstringsWithSeparators): likewise
206 (KJS::UString::append): likewise
207 (KJS::UString::operator=): likewise
208 (KJS::UString::detach): likewise
209 * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
211 2005-04-11 Maciej Stachowiak <mjs@apple.com>
215 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
217 - Avoid using protected values hash for the two most common cases
218 - Bump up ListImp high water mark, new testing shows 508 ListImps are
219 created during JS iBench.
221 Net result is a 5.6% speedup on JavaScript iBench
224 (KJS::Collector::collect): mark protected lists as appropriate.
227 (KJS::ListImp::markValues): Moved implementation from List::markValues
228 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
230 (KJS::allocateListImp): link lists outside the pool into a separate
231 doubly linked list to be able to mark protected lists
232 (KJS::deallocateListImp): do the corresponding delinking
233 (KJS::List::derefValues): do nothing in conservative GC mode
234 (KJS::List::refValues): do nothing in conservative GC mode
235 (KJS::List::markValues): call ListImp version
251 2005-03-16 Jens Alfke <jens@apple.com>
255 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
256 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.
257 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.)
258 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
261 (KJS::GlobalFuncImp::call):
263 2005-03-15 Richard Williamson <rjw@apple.com>
265 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
267 Added JavaScript boolean to type that can be converted to
268 ObjC scalar parameters.
270 Reviewed by Ken Kocienda.
272 * bindings/objc/objc_utility.mm:
273 (KJS::Bindings::convertValueToObjcValue):
289 2005-02-21 Darin Adler <darin@apple.com>
291 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
293 2005-02-17 Richard Williamson <rjw@apple.com>
295 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
299 Reviewed by John Sullivan.
301 * bindings/jni/jni_runtime.cpp:
302 (JavaField::valueFromInstance):
306 2005-02-11 Richard Williamson <rjw@apple.com>
308 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
310 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
311 creates these wrappers. The WebCore subclass of the interpreter now overrides
312 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
316 * bindings/c/c_utility.cpp:
317 (convertValueToNPVariant):
318 * bindings/jni/jni_instance.cpp:
319 (JavaInstance::invokeMethod):
320 * bindings/jni/jni_objc.mm:
321 (KJS::Bindings::dispatchJNICall):
322 * bindings/jni/jni_runtime.cpp:
323 (JavaField::valueFromInstance):
324 (JavaArray::valueAt):
325 * bindings/objc/WebScriptObject.mm:
326 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
327 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
328 * bindings/objc/WebScriptObjectPrivate.h:
329 * bindings/objc/objc_utility.h:
330 * bindings/objc/objc_utility.mm:
331 (KJS::Bindings::convertObjcValueToValue):
332 (KJS::Bindings::createObjcInstanceForValue):
333 * bindings/runtime.cpp:
334 (Instance::createBindingForLanguageInstance):
335 (Instance::createRuntimeObject):
336 (Instance::createLanguageInstanceForValue):
337 * bindings/runtime.h:
338 * kjs/interpreter.cpp:
339 (Interpreter::createLanguageInstanceForValue):
344 2005-02-10 Darin Adler <darin@apple.com>
346 "Reviewed" by Richard (he told me the file was obsolete).
348 - got rid of an obsolete file
350 * bindings/npsap.h: Removed.
356 2005-02-03 Richard Williamson <rjw@apple.com>
358 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
360 Revert to old (and correct) behavior of returning runtime object
361 when passed as a parameter, rather than it's corresponding DOM
366 * bindings/objc/WebScriptObject.mm:
367 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
371 2005-01-28 Richard Williamson <rjw@apple.com>
373 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
375 Only use special 'back door' property to get the runtime object if thisObj isn't
376 already a runtime object.
378 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
379 ClassInfo pointer instead.
383 * bindings/c/c_utility.cpp:
384 (convertValueToNPVariant):
385 * bindings/objc/WebScriptObject.mm:
386 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
387 * bindings/runtime_method.cpp:
388 (RuntimeMethodImp::call):
392 2005-01-26 Richard Williamson <rjw@apple.com>
394 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
396 I added a member variable to ObjectImp. This changed it's size and consequently
397 hampered the optimizations built into the garbage collector. Objects no longer
398 fit within the allocators cell size, and thus allocation fell back to a slower
401 As a result of this fix I also dramatically cleaned up how runtime objects are
402 accessed. The path mostly *removes* code.
406 * bindings/runtime_method.cpp:
407 (RuntimeMethodImp::call):
408 * bindings/runtime_object.cpp:
409 (RuntimeObjectImp::get):
410 (RuntimeObjectImp::put):
411 (RuntimeObjectImp::canPut):
412 (RuntimeObjectImp::hasProperty):
413 (RuntimeObjectImp::defaultValue):
414 * bindings/runtime_object.h:
416 (KJS::ObjectImp::ObjectImp):
419 2005-01-20 Darin Adler <darin@apple.com>
421 Reviewed by me, changes by Han Ming Ong.
423 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
425 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
426 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
428 2005-01-20 Richard Williamson <rjw@apple.com>
430 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
432 The comprehensive fix for this problem requires new API, as described in 3965326. However,
433 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
434 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
435 implemented on the bound object.
439 * bindings/objc/objc_runtime.h:
440 * bindings/objc/objc_runtime.mm:
441 (ObjcFallbackObjectImp::type):
442 (ObjcFallbackObjectImp::implementsCall):
443 (ObjcFallbackObjectImp::toBoolean):
444 * bindings/testbindings.mm:
445 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
446 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
450 2005-01-19 Richard Williamson <rjw@apple.com>
452 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
454 Fixed the following problems with LiveConnect that are demonstrated by the application
455 described in 3853676.
457 1. If a nil object is passed in an array from Java to JavaScript we will crash.
458 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
459 3. We will sometimes fail to find the correct static method ID.
463 * bindings/jni/jni_jsobject.cpp:
464 (JSObject::convertJObjectToValue):
465 (JSObject::listFromJArray):
466 * bindings/jni/jni_runtime.cpp:
467 (JavaField::valueFromInstance):
468 (JavaField::setValueToInstance):
469 * bindings/jni/jni_utility.cpp:
470 (KJS::Bindings::getMethodID):
471 (KJS::Bindings::convertValueToJValue):
472 * bindings/runtime_array.h:
474 2005-01-18 Richard Williamson <rjw@apple.com>
476 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
478 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
479 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
480 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
481 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
483 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
484 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
485 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
489 * bindings/objc/objc_instance.h:
490 * bindings/objc/objc_instance.mm:
491 (ObjcInstance::supportsSetValueOfUndefinedField):
492 * bindings/runtime.h:
493 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
494 * bindings/runtime_object.cpp:
495 (RuntimeObjectImp::RuntimeObjectImp):
496 (RuntimeObjectImp::get):
497 (RuntimeObjectImp::put):
498 (RuntimeObjectImp::canPut):
499 (RuntimeObjectImp::hasProperty):
500 (RuntimeObjectImp::defaultValue):
501 * bindings/runtime_object.h:
502 (KJS::RuntimeObjectImp::fallbackObject):
504 (KJS::ObjectImp::ObjectImp):
506 (KJS::ObjectImp::forwardingScriptMessage):
507 (KJS::ObjectImp::setForwardingScriptMessage):
509 2005-01-18 Richard Williamson <rjw@apple.com>
511 Back out a change that was incorrectly committed yesterday.
515 * bindings/objc/objc_utility.mm:
516 (KJS::Bindings::convertValueToObjcValue):
518 2005-01-17 Richard Williamson <rjw@apple.com>
520 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
522 Keep track of originating execution context and target execution
523 context for native JS object wrappers, and perform appropriate
526 Reviewed by David Harrison.
528 * bindings/NP_jsobject.cpp:
530 (_NPN_CreateScriptObject):
535 (_NPN_RemoveProperty):
539 * bindings/NP_jsobject.h:
540 * bindings/c/c_instance.cpp:
541 (CInstance::CInstance):
542 (CInstance::stringValue):
543 * bindings/c/c_instance.h:
544 * bindings/c/c_utility.cpp:
545 (convertValueToNPVariant):
546 * bindings/jni/jni_instance.cpp:
547 (JavaInstance::JavaInstance):
548 (JavaInstance::valueOf):
549 * bindings/jni/jni_instance.h:
550 * bindings/objc/WebScriptObject.mm:
551 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
552 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
553 (-[WebScriptObject KJS::Bindings::]):
554 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
555 (-[WebScriptObject _isSafeScript]):
556 (-[WebScriptObject callWebScriptMethod:withArguments:]):
557 (-[WebScriptObject evaluateWebScript:]):
558 (-[WebScriptObject setValue:forKey:]):
559 (-[WebScriptObject valueForKey:]):
560 (-[WebScriptObject removeWebScriptKey:]):
561 (-[WebScriptObject stringRepresentation]):
562 (-[WebScriptObject webScriptValueAtIndex:]):
563 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
564 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
565 * bindings/objc/WebScriptObjectPrivate.h:
566 * bindings/objc/objc_instance.h:
567 * bindings/objc/objc_runtime.mm:
568 (convertValueToObjcObject):
569 * bindings/objc/objc_utility.mm:
570 (KJS::Bindings::convertValueToObjcValue):
571 * bindings/runtime.cpp:
572 (Instance::Instance):
573 (Instance::operator=):
574 * bindings/runtime.h:
575 (KJS::Bindings::Instance::Instance):
576 (KJS::Bindings::Instance::setExecutionContext):
577 (KJS::Bindings::Instance::executionContext):
578 * bindings/runtime_root.cpp:
579 (RootObject::setInterpreter):
580 * bindings/runtime_root.h:
582 (KJS::Interpreter::isGlobalObject):
583 (KJS::Interpreter::interpreterForGlobalObject):
584 (KJS::Interpreter::isSafeScript):
588 2005-01-13 Vicki Murley <vicki@apple.com>
592 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
594 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
596 2005-01-12 Richard Williamson <rjw@apple.com>
598 Avoid additional work on dealloc by adding early out to
599 removeNativeReference(). (This will save time on dealloc
600 for all ObjC DOM objects.)
604 * bindings/runtime_root.cpp:
605 (KJS::Bindings::removeNativeReference):
607 2005-01-12 Richard Williamson <rjw@apple.com>
609 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
611 We were always returning the first "root" object for all runtime
612 objects. Changed 0 in loop to i, the index.
614 Reviewed by David Harrison.
616 * bindings/runtime_root.cpp:
617 (KJS::Bindings::rootForImp):
619 2005-01-11 Richard Williamson <rjw@apple.com>
621 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
623 Use the new dispatching API to invoke JNI, rather than calling JNI
626 Reviewed by David Harrison.
628 * bindings/jni/jni_instance.cpp:
629 (JavaInstance::invokeMethod):
630 * bindings/jni/jni_runtime.cpp:
631 (JavaField::dispatchValueFromInstance):
632 (JavaField::valueFromInstance):
633 (JavaField::dispatchSetValueToInstance):
634 (JavaField::setValueToInstance):
635 * bindings/jni/jni_runtime.h:
636 * bindings/jni/jni_utility.cpp:
637 (KJS::Bindings::convertValueToJValue):
645 2004-12-17 Maciej Stachowiak <mjs@apple.com>
649 <rdar://problem/3926869> Opening caches window after running PLT causes crash
651 * kjs/protected_values.cpp:
652 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
653 the protected value table.
654 (KJS::ProtectedValues::increaseProtectCount): Ditto.
655 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
657 2004-12-16 Darin Adler <darin@apple.com>
661 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
663 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
664 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
665 non-locale-specific versions.
666 * kjs/string_object.lut.h: Regenerated.
668 2004-12-14 Richard Williamson <rjw@apple.com>
670 Pass URL of plugin view when call into JNI.
674 * bindings/jni/jni_objc.mm:
675 (KJS::Bindings::dispatchJNICall):
677 2004-12-13 Richard Williamson <rjw@apple.com>
679 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
681 Add support for calling static Java methods from JavaScript.
685 * bindings/jni/jni_instance.cpp:
686 (JavaInstance::invokeMethod):
687 * bindings/jni/jni_runtime.cpp:
688 (JavaMethod::JavaMethod):
689 * bindings/jni/jni_runtime.h:
690 (KJS::Bindings::JavaMethod::isStatic):
691 * bindings/jni/jni_utility.cpp:
692 (callJNIStaticMethod):
693 (KJS::Bindings::callJNIBooleanMethod):
694 (KJS::Bindings::callJNIStaticBooleanMethod):
695 * bindings/jni/jni_utility.h:
697 2004-12-13 Richard Williamson <rjw@apple.com>
699 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
703 * bindings/jni/jni_instance.cpp:
704 (JavaInstance::invokeMethod):
705 * bindings/jni/jni_objc.mm:
706 (KJS::Bindings::dispatchJNICall):
707 * bindings/jni/jni_runtime.h:
708 * bindings/jni/jni_utility.h:
712 2004-12-07 Maciej Stachowiak <mjs@apple.com>
716 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
718 The fix was to implement copy constructor and assignment operator,
719 the ones that worked on the base class did not replace the
723 (KJS::ProtectedValue::ProtectedValue):
724 (KJS::ProtectedValue::operator=):
725 (KJS::ProtectedObject::ProtectedObject):
726 (KJS::ProtectedObject::operator=):
728 Also fixed a bug in the GC test mode that compares the results of
729 the old collector and the new collector.
736 2004-11-23 Richard Williamson <rjw@apple.com>
738 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
742 * bindings/c/c_class.cpp:
743 (CClass::_commonInit):
745 2004-11-21 Maciej Stachowiak <mjs@apple.com>
749 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
752 (KJS::Collector::Thread::Thread):
753 (KJS::destroyRegisteredThread):
754 (KJS::initializeRegisteredThreadKey):
755 (KJS::Collector::registerThread):
756 (KJS::Collector::markStackObjectsConservatively):
757 (KJS::Collector::markCurrentThreadConservatively):
758 (KJS::Collector::markOtherThreadConservatively):
766 2004-11-15 Richard Williamson <rjw@apple.com>
768 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
772 * bindings/objc/objc_instance.mm:
773 (ObjcInstance::stringValue):
774 * bindings/objc/objc_utility.h:
775 * bindings/objc/objc_utility.mm:
776 (KJS::Bindings::convertNSStringToString):
777 (KJS::Bindings::convertObjcValueToValue):
781 2004-11-09 Chris Blumenberg <cblu@apple.com>
783 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
788 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
789 * bindings/softlinking.c: Added.
791 (getFunctionPointer): new
792 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
796 2004-11-04 Darin Adler <darin@apple.com>
800 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
801 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
802 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
803 than allocating a new one
805 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
806 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
807 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
808 actually allocate only the very first time it's called.
809 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
810 shared instance since there can be only one).
811 (-[WebUndefined copyWithZone:]): Ditto.
812 (-[WebUndefined retain]): Ditto.
813 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
815 (-[WebUndefined autorelease]): Simplified to just return self (see above).
816 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
817 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
818 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
819 bug mentioned above).
820 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
821 No need to call init, since that's a no-op for this class.
823 2004-11-03 David Harrison <harrison@apple.com>
827 Eliminate the use of a marker file to determine how to build.
832 2004-11-01 Richard Williamson <rjw@apple.com>
834 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
838 * bindings/c/c_instance.cpp:
839 (CInstance::invokeMethod):
840 (CInstance::invokeDefaultMethod):
841 Initialize out parameters to void type.
843 * bindings/c/c_runtime.cpp:
844 (CField::valueFromInstance):
845 (CField::setValueToInstance):
846 Initialize out parameters to void type.
847 Also added additional checks to protect against classes that
848 don't implement all functions.
850 2004-11-01 Richard Williamson <rjw@apple.com>
852 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
857 * bindings/objc/WebScriptObject.mm:
858 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
859 Added additional conversion Undefined -> WebUndefined.
860 * bindings/objc/objc_utility.mm:
861 (KJS::Bindings::convertObjcValueToValue):
862 Added additional conversion WebUndefined -> Undefined.
864 2004-11-01 Darin Adler <darin@apple.com>
866 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
868 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
869 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
870 report to match the contents of the file.
876 2004-10-22 Ken Kocienda <kocienda@apple.com>
880 * JavaScriptCore.pbproj/project.pbxproj:
881 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
885 2004-10-13 Richard Williamson <rjw@apple.com>
887 Moved boolean checks prior to NSNumber checks. booleans are
890 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
894 * bindings/objc/objc_utility.mm:
895 (KJS::Bindings::convertObjcValueToValue):
897 2004-10-12 Richard Williamson <rjw@apple.com>
899 Fixed access to DOM object via WebScriptObject API.
900 The execution context for DOM objects wasn't being found.
901 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
905 * bindings/objc/WebScriptObject.mm:
907 (-[WebScriptObject KJS::Bindings::]):
908 (-[WebScriptObject callWebScriptMethod:withArguments:]):
909 (-[WebScriptObject evaluateWebScript:]):
910 (-[WebScriptObject setValue:forKey:]):
911 (-[WebScriptObject valueForKey:]):
912 (-[WebScriptObject stringRepresentation]):
913 * bindings/objc/WebScriptObjectPrivate.h:
915 2004-10-09 Darin Adler <darin@apple.com>
919 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
921 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
922 creating an init routine.
924 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
925 require a global constructor that creates an init routine.
927 2004-10-09 Darin Adler <darin@apple.com>
931 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
933 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
934 work with the window object of the page the function is in, not the page of the caller. This
935 is what all other browsers do. This code was hidden before by the "everything is defined on
936 window object" hack in WebCore.
938 2004-10-07 Richard Williamson <rjw@apple.com>
940 Added simple JavaScript call tracing. Very useful for
941 debugging complex pages.
943 Tracing is only available in development builds and is
946 (gdb) set traceJavaScript = 1
950 setTraceJavaScript(true)
952 Function, args, and return values are printed to console. Very
957 * kjs/function_object.cpp:
958 (FunctionProtoFuncImp::call):
964 2004-10-05 Richard Williamson <rjw@apple.com>
966 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
970 * bindings/NP_jsobject.cpp:
972 * bindings/npruntime.cpp:
973 (_NPN_SetExceptionWithUTF8):
974 * bindings/objc/WebScriptObject.mm:
975 (+[WebScriptObject throwException:]):
977 (KJS::InterpreterImp::context):
979 2004-10-05 Richard Williamson <rjw@apple.com>
981 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
985 * bindings/objc/objc_utility.mm:
986 (KJS::Bindings::convertObjcValueToValue):
988 2004-10-04 Darin Adler <darin@apple.com>
992 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
994 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
996 - rolled out an old workaround we don't need any more
998 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
999 required it is no longer there.
1001 2004-09-30 Richard Williamson <rjw@apple.com>
1003 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
1007 * bindings/NP_jsobject.cpp:
1011 * bindings/c/c_class.cpp:
1012 (CClass::methodsNamed):
1013 (CClass::fieldNamed):
1014 * bindings/c/c_class.h:
1015 * bindings/c/c_instance.cpp:
1016 (CInstance::invokeMethod):
1017 * bindings/jni/jni_class.cpp:
1018 (JavaClass::methodsNamed):
1019 * bindings/jni/jni_class.h:
1020 * bindings/npruntime.h:
1021 * bindings/objc/objc_class.h:
1022 * bindings/objc/objc_class.mm:
1023 (ObjcClass::methodsNamed):
1024 * bindings/runtime.h:
1025 * bindings/runtime_object.cpp:
1026 (RuntimeObjectImp::get):
1027 (RuntimeObjectImp::hasProperty):
1029 2004-09-29 Chris Blumenberg <cblu@apple.com>
1031 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.
1035 * JavaScriptCore.pbproj/project.pbxproj:
1036 * bindings/NP_jsobject.cpp:
1037 (_NPN_CreateScriptObject):
1038 (_NPN_InvokeDefault):
1043 (_NPN_RemoveProperty):
1046 * bindings/c/c_class.cpp:
1047 (CClass::methodsNamed):
1048 (CClass::fieldNamed):
1049 * bindings/c/c_instance.cpp:
1050 (CInstance::CInstance):
1051 (CInstance::~CInstance):
1052 (CInstance::operator=):
1053 (CInstance::invokeMethod):
1054 (CInstance::invokeDefaultMethod):
1055 * bindings/c/c_runtime.cpp:
1056 * bindings/c/c_runtime.h:
1057 (KJS::Bindings::CField::name):
1058 (KJS::Bindings::CMethod::name):
1059 * bindings/npruntime.cpp:
1060 (_NPN_GetStringIdentifier):
1061 (_NPN_GetStringIdentifiers):
1062 (_NPN_GetIntIdentifier):
1063 (_NPN_IdentifierIsString):
1064 (_NPN_UTF8FromIdentifier):
1065 (_NPN_IntFromIdentifier):
1066 (NPN_InitializeVariantWithObject):
1067 (_NPN_ReleaseVariantValue):
1068 (_NPN_CreateObject):
1069 (_NPN_RetainObject):
1070 (_NPN_ReleaseObject):
1071 (_NPN_SetExceptionWithUTF8):
1072 (_NPN_SetException):
1074 2004-09-26 Darin Adler <darin@apple.com>
1076 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
1077 low() to get Unicode value of character, and just use unicode().
1079 2004-09-26 Darin Adler <darin@apple.com>
1081 - refine charAt/charCodeAt fix slightly
1083 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
1084 omitted parameter, as we do everywhere else, and as other browsers do here.
1086 2004-09-26 Darin Adler <darin@apple.com>
1090 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
1092 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
1093 the program. We were doing this properly for functions, but not entire programs.
1095 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
1097 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
1098 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
1100 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
1106 2004-09-14 Richard Williamson <rjw@apple.com>
1108 1. Add class parameter to object allocation function. This is somewhat redundant, given that
1109 the allocation function is in the class function vector, but people wanted to use the same
1110 allocation function for different classes.
1112 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
1114 3. Add support for a default function on an object. This is a feature that ActiveX supports,
1115 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
1116 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
1117 'Objective-C' bindings.
1119 There bugs are covered by
1121 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
1122 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
1123 <rdar://problem/3674754> Need to implement latest npruntime.h
1127 * bindings/NP_jsobject.cpp:
1129 (NPN_InvokeDefault):
1131 * bindings/c/c_class.cpp:
1132 * bindings/c/c_instance.cpp:
1133 (CInstance::CInstance):
1134 (CInstance::operator=):
1135 (CInstance::invokeMethod):
1136 (CInstance::invokeDefaultMethod):
1137 * bindings/c/c_instance.h:
1138 * bindings/c/c_runtime.cpp:
1139 * bindings/c/c_runtime.h:
1140 * bindings/jni/jni_instance.cpp:
1141 (JavaInstance::invokeDefaultMethod):
1142 * bindings/jni/jni_instance.h:
1143 * bindings/npruntime.cpp:
1145 * bindings/npruntime.h:
1146 * bindings/objc/WebScriptObject.h:
1147 * bindings/objc/objc_class.mm:
1148 (ObjcClass::fallbackObject):
1149 * bindings/objc/objc_instance.h:
1150 * bindings/objc/objc_instance.mm:
1151 (ObjcInstance::invokeDefaultMethod):
1152 * bindings/objc/objc_runtime.h:
1153 * bindings/objc/objc_runtime.mm:
1154 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1155 (ObjcFallbackObjectImp::get):
1156 (ObjcFallbackObjectImp::put):
1157 (ObjcFallbackObjectImp::canPut):
1158 (ObjcFallbackObjectImp::implementsCall):
1159 (ObjcFallbackObjectImp::call):
1160 (ObjcFallbackObjectImp::hasProperty):
1161 (ObjcFallbackObjectImp::deleteProperty):
1162 (ObjcFallbackObjectImp::defaultValue):
1163 * bindings/runtime.h:
1164 (KJS::Bindings::Class::fallbackObject):
1165 (KJS::Bindings::Instance::getValueOfUndefinedField):
1166 (KJS::Bindings::Instance::setValueOfUndefinedField):
1167 (KJS::Bindings::Instance::valueOf):
1168 * bindings/runtime_object.cpp:
1169 (RuntimeObjectImp::implementsCall):
1170 (RuntimeObjectImp::call):
1171 * bindings/runtime_object.h:
1173 2004-09-13 Maciej Stachowiak <mjs@apple.com>
1177 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1179 * kjs/string_object.cpp:
1180 (StringProtoFuncImp::call): Replaced implementation of replace()
1181 method with function below...
1182 (replace): In order to avoid excessive allocation and copying,
1183 figure out the ranges of the original string and replacement
1184 strings to be assembled, instead of constantly creating new
1185 strings at each substitution. The old behavior is basically O(N^2)
1186 for a global replace on a pattern that matches many places in the
1188 (regExpIsGlobal): Helper function for the above.
1189 (expandSourceRanges): ditto
1190 (pushSourceRange): ditto
1191 (expandReplacements): ditto
1192 (pushReplacement): ditto
1194 (KJS::UString::spliceSubstringsWithSeparators): New method that
1195 pieces together substring ranges of this string together with
1196 specified separators, all at one go.
1198 (KJS::UString::Range::Range): Added new helper class to represent
1201 2004-09-14 Maciej Stachowiak <mjs@apple.com>
1205 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1208 (KJS::GlobalFuncImp::call): Make sure to escape null
1209 characters. This is a bug in the new code that made part of the
1212 2004-09-13 Darin Adler <darin@apple.com>
1214 Reviewed by Kevin and Maciej.
1216 - new function to support fix for DIG bug in WebCore
1218 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1219 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1221 2004-09-12 Darin Adler <darin@apple.com>
1223 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1224 of escape and unescape.
1226 2004-09-12 Darin Adler <darin@apple.com>
1230 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1232 * kjs/date_object.cpp:
1233 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1234 uses CFDateFormatter.
1235 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1237 2004-09-09 Maciej Stachowiak <mjs@apple.com>
1239 Reviewed by Richard.
1241 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1244 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1245 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1247 (Lexer::isHexDigit): Made static and non-const.
1252 2004-09-06 Darin Adler <darin@apple.com>
1254 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1258 2004-09-01 Richard Williamson <rjw@apple.com>
1260 Add pid to exception messages (to help debug dashboard clients).
1264 * kjs/interpreter.cpp:
1265 (Interpreter::evaluate):
1269 2004-08-20 Richard Williamson <rjw@apple.com>
1271 Implemented new JNI abstraction. We no longer invoke Java methods
1272 directly with JNI, rather we call into the plugin. This allows the
1273 plugin to dispatch the call to the appropriate VM thread. This
1274 change should (will?) fix a whole class of threading related problems with
1279 * JavaScriptCore.pbproj/project.pbxproj:
1280 * bindings/c/c_instance.h:
1281 (KJS::Bindings::CInstance::setExecutionContext):
1282 (KJS::Bindings::CInstance::executionContext):
1283 * bindings/jni/jni_instance.cpp:
1284 (JavaInstance::JavaInstance):
1285 (JavaInstance::invokeMethod):
1286 (JavaInstance::setExecutionContext):
1287 (JavaInstance::executionContext):
1288 * bindings/jni/jni_instance.h:
1289 * bindings/jni/jni_jsobject.cpp:
1290 (JSObject::convertJObjectToValue):
1291 * bindings/jni/jni_runtime.cpp:
1292 (JavaField::JavaField):
1293 (JavaArray::convertJObjectToArray):
1294 (JavaField::valueFromInstance):
1295 (JavaArray::JavaArray):
1296 (JavaArray::valueAt):
1297 * bindings/jni/jni_runtime.h:
1298 (KJS::Bindings::JavaArray::operator=):
1299 (KJS::Bindings::JavaArray::executionContext):
1300 * bindings/jni/jni_utility.h:
1301 * bindings/objc/objc_instance.h:
1302 (KJS::Bindings::ObjcInstance::setExecutionContext):
1303 (KJS::Bindings::ObjcInstance::executionContext):
1304 * bindings/runtime.cpp:
1305 (Instance::createBindingForLanguageInstance):
1306 * bindings/runtime.h:
1307 * bindings/runtime_root.h:
1308 (KJS::Bindings::RootObject::nativeHandle):
1312 2004-08-19 Vicki Murley <vicki@apple.com>
1316 * kjs/property_map.cpp:
1317 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1319 2004-08-17 Darin Adler <darin@apple.com>
1323 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1325 * kjs/property_map.h: Added some private functions.
1326 * kjs/property_map.cpp:
1327 (KJS::PropertyMap::clear): Set sentinelCount to 0.
1328 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1329 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1330 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1331 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1332 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1333 deleted-element sentinels.
1334 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1336 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1338 Code change by Eric Albert, reviewd by me.
1340 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1342 * kjs/date_object.cpp:
1343 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1344 entirely would be even better, but is not required to fix this bug.
1348 2004-08-16 Richard Williamson <rjw@apple.com>
1350 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1352 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1356 * bindings/NP_jsobject.cpp:
1358 * bindings/jni/jni_jsobject.cpp:
1360 * bindings/objc/WebScriptObject.mm:
1361 (-[WebScriptObject evaluateWebScript:]):
1363 2004-08-15 Richard Williamson <rjw@apple.com>
1365 More updates to np headers. Implemented new NPN functions.
1369 * bindings/NP_jsobject.cpp:
1373 * bindings/npruntime.h:
1375 2004-08-13 Darin Adler <darin@apple.com>
1377 - fix build so we can compile again
1379 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1380 is good enough so that we can compile, but it's only a stopgap measure, because I think
1381 Richard has a newer one he wants to check in.
1383 2004-08-12 Richard Williamson <rjw@apple.com>
1385 Bring npruntime.h and friends closer to compliance with
1390 * JavaScriptCore.pbproj/project.pbxproj:
1391 * bindings/NP_jsobject.cpp:
1393 (_NPN_CreateScriptObject):
1398 (NPN_RemoveProperty):
1399 * bindings/NP_jsobject.h:
1400 * bindings/c/c_instance.cpp:
1401 (CInstance::invokeMethod):
1402 * bindings/c/c_utility.cpp:
1403 (convertNPVariantToValue):
1404 * bindings/npruntime.cpp:
1405 (NPN_IdentifierIsString):
1406 (NPN_VariantIsVoid):
1407 (NPN_VariantIsNull):
1408 (NPN_VariantIsUndefined):
1409 (NPN_VariantIsBool):
1410 (NPN_VariantIsInt32):
1411 (NPN_VariantIsDouble):
1412 (NPN_VariantIsString):
1413 (NPN_VariantIsObject):
1414 (NPN_VariantToBool):
1415 (NPN_VariantToString):
1416 (NPN_VariantToInt32):
1417 (NPN_VariantToDouble):
1418 (NPN_VariantToObject):
1419 (NPN_InitializeVariantAsVoid):
1420 (NPN_InitializeVariantAsNull):
1421 (NPN_InitializeVariantAsUndefined):
1422 (NPN_InitializeVariantWithBool):
1423 (NPN_InitializeVariantWithInt32):
1424 (NPN_InitializeVariantWithDouble):
1425 (NPN_InitializeVariantWithString):
1426 (NPN_InitializeVariantWithStringCopy):
1427 (NPN_InitializeVariantWithObject):
1428 (NPN_InitializeVariantWithVariant):
1429 (NPN_ReleaseVariantValue):
1431 * bindings/npruntime.h:
1433 (_NPString::_NPVariant::):
1434 * bindings/npruntime_priv.h: Added.
1436 2004-08-12 Darin Adler <darin@apple.com>
1440 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1443 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1444 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1445 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1446 to skip leading "+" or "-".
1450 2004-08-12 Darin Adler <darin@apple.com>
1454 - fixed 43 Mozilla JavaScript tests
1456 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1457 * kjs/date_object.cpp:
1458 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1459 than constructing a number object to pass to it.
1460 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1461 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1462 (KJS::timeClip): Implement this as specified in the language standard.
1464 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1465 flags on the prototype property.
1468 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1470 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1472 (KJS::parseDigit): Added. Helper function for parseInt.
1473 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1474 strtoll can handle. Also matches standard more closely.
1475 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1477 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1479 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1481 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1483 (Lexer::setCode): Clear error state.
1484 (Lexer::lex): Set error state if the lexer encounters an error
1487 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1488 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1490 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1491 Change round to round values between -0.5 and -0 to -0 instead of +0.
1493 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1494 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1495 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1496 would change x.y into a value that can't be deleted as a side effect.
1498 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1501 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1502 get rid of the fixed size limit for code.
1504 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1505 returns the string without creating a new Rep, since I'm using substr in a place where it will
1506 often be passed a 0.
1508 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1509 the other day that was making a couple tests fail.
1510 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1511 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1512 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1513 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1514 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1516 * kjs/string_object.lut.h: Regenerated.
1518 2004-08-11 Darin Adler <darin@apple.com>
1520 - fixed a tiny problem with the UTF-16 PCRE check-in
1522 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1523 the ctype_meta flag to get set in items that should not have it.
1525 * pcre/chartables.c: Regenerated.
1527 2004-08-10 Richard Williamson <rjw@apple.com>
1529 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1531 The following WebScripting methods are now supported on bound
1534 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1535 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1536 - (id)valueForUndefinedKey:(NSString *)key
1540 * bindings/c/c_class.cpp:
1541 (CClass::fieldNamed):
1542 * bindings/c/c_class.h:
1543 * bindings/jni/jni_class.cpp:
1544 (JavaClass::fieldNamed):
1545 * bindings/jni/jni_class.h:
1546 * bindings/objc/objc_class.h:
1547 (KJS::Bindings::ObjcClass::isa):
1548 * bindings/objc/objc_class.mm:
1549 (ObjcClass::methodsNamed):
1550 (ObjcClass::fieldNamed):
1551 (ObjcClass::fallbackObject):
1552 * bindings/objc/objc_instance.h:
1553 * bindings/objc/objc_instance.mm:
1554 (ObjcInstance::invokeMethod):
1555 (ObjcInstance::setValueOfField):
1556 (ObjcInstance::setValueOfUndefinedField):
1557 (ObjcInstance::getValueOfField):
1558 (ObjcInstance::getValueOfUndefinedField):
1559 * bindings/objc/objc_runtime.h:
1560 (KJS::Bindings::ObjcField::~ObjcField):
1561 (KJS::Bindings::ObjcField::ObjcField):
1562 (KJS::Bindings::ObjcField::operator=):
1563 (KJS::Bindings::FallbackObjectImp::classInfo):
1564 * bindings/objc/objc_runtime.mm:
1565 (ObjcField::ObjcField):
1568 (ObjcField::valueFromInstance):
1569 (ObjcField::setValueToInstance):
1570 (FallbackObjectImp::FallbackObjectImp):
1571 (FallbackObjectImp::get):
1572 (FallbackObjectImp::put):
1573 (FallbackObjectImp::canPut):
1574 (FallbackObjectImp::implementsCall):
1575 (FallbackObjectImp::call):
1576 (FallbackObjectImp::hasProperty):
1577 (FallbackObjectImp::deleteProperty):
1578 (FallbackObjectImp::defaultValue):
1579 * bindings/runtime.h:
1580 (KJS::Bindings::Class::fallbackObject):
1581 (KJS::Bindings::Instance::getValueOfUndefinedField):
1582 (KJS::Bindings::Instance::setValueOfUndefinedField):
1583 * bindings/runtime_object.cpp:
1584 (RuntimeObjectImp::get):
1585 (RuntimeObjectImp::put):
1586 (RuntimeObjectImp::canPut):
1587 (RuntimeObjectImp::hasProperty):
1588 * bindings/testbindings.mm:
1589 (-[MyFirstInterface valueForUndefinedKey:]):
1590 (-[MyFirstInterface setValue:forUndefinedKey:]):
1592 2004-08-10 Darin Adler <darin@apple.com>
1596 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1598 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1599 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1600 that need to use it.
1601 * pcre/pcre.c: Add UTF-16 support to all functions.
1602 * pcre/study.c: Ditto.
1604 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1605 the mode. Changed declarations to use symbolic constants and typedefs so we size
1606 things to ichar when needed.
1608 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1609 sized to 16-bit characters instead of 8-bit.
1612 (pcre_copy_substring): Use pcre_char instead of char.
1613 (pcre_get_substring_list): Ditto.
1614 (pcre_free_substring_list): Ditto.
1615 (pcre_get_substring): Ditto.
1616 (pcre_free_substring): Ditto.
1618 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1619 of hard-coding 8-bit table sizes.
1621 * pcre/chartables.c: Regenerated.
1623 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1624 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1625 is not null. The null string still has a null pointer. This prevents us from
1626 passing a null through to the regular expression engine (which results in a null
1627 error even when the string length is 0).
1630 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1631 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1633 2004-08-09 Darin Adler <darin@apple.com>
1637 - fixed 28 Mozilla JavaScript tests
1639 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1640 checking the number of arguments for the join method.
1642 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1643 than integers, so we aren't limited to 32 bits.
1645 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1646 the implementation of the pow operation. Also simplied a case that was handling positive
1647 and negative infinity separately.
1649 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1650 putting them in a long, so that unsigned shift will work properly.
1652 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1654 * kjs/operations.cpp:
1655 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1656 sign of isinf; our isinf function returns +1 even for negative infinity.
1657 (KJS::isNegInf): And again.
1658 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1659 Our floating point already handles the various infinity cases correctly.
1661 * kjs/regexp_object.cpp:
1662 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1663 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1664 array in cases where we did not match.
1665 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1666 "global", "ignoreCase", "multiline", and "source".
1668 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1669 string into undefined rather than an empty string. For the slice method, handle an
1670 undefined parameter for the limit properly as decribed in the specification, and add
1671 the limit to one case that didn't have the limit at all. For the methods that generate
1672 HTML strings, use lowercase tags instead of uppercase.
1675 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1676 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1677 (KJS::UString::append): Fix some math that caused a buffer overflow.
1678 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1679 flag) rather than converting them all to 0.
1680 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1682 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1684 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1685 the Unicode specification in a few cases where it was wrong before.
1686 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1687 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1688 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1689 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1690 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1691 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1692 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1693 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1694 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1696 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1698 * kjs/number_object.lut.h: Regenerated.
1700 2004-08-09 Darin Adler <darin@apple.com>
1704 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1706 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1707 we get a buffer overflow.
1711 2004-08-05 Richard Williamson <rjw@apple.com>
1713 Fixed part of 3674747. The QT guys need this for feature freeze.
1715 This patch implements support for the
1717 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1719 method of objects bound to JavaScript.
1724 * bindings/objc/objc_class.mm:
1725 (ObjcClass::methodsNamed):
1726 (ObjcClass::fieldNamed):
1727 * bindings/objc/objc_instance.mm:
1728 (ObjcInstance::invokeMethod):
1729 * bindings/objc/objc_runtime.h:
1730 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1731 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1732 (KJS::Bindings::ObjcMethod::javaScriptName):
1733 * bindings/objc/objc_runtime.mm:
1734 (ObjcMethod::ObjcMethod):
1735 (ObjcMethod::getMethodSignature):
1736 (ObjcMethod::setJavaScriptName):
1737 * bindings/testbindings.mm:
1739 2004-08-04 Vicki Murley <vicki@apple.com>
1743 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1746 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1747 go to the next line and continue parsing the string (instead of failing). This matches
1748 behavior in Mac IE and Mozilla.
1750 2004-08-03 Kevin Decker <kdecker@apple.com>
1754 Rolled in changes from the latest KJS sources that support additional
1755 Number.prototype functions.
1757 Specifically this patch covers the follow parts of the ECMA 3 spec:
1758 15.7.4.5, 15.7.4.6, and 15.7.4.7
1761 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1762 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1763 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1765 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1766 list of supported identifiers (a macro).
1767 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1768 and toExponential().
1769 (NumberPrototypeImp::NumberPrototypeImp):
1770 (NumberProtoFuncImp::call):
1771 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1773 (KJS::NumberProtoFuncImp::):
1774 * tests/mozilla/expected.html: Update results.
1776 2004-08-03 Darin Adler <darin@apple.com>
1780 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1782 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1783 we are supposed to just copy the regular expression object, and do so.
1784 Also tighten up arguments check to handle case where an actual "undefined"
1785 is passed rather than just omitting an argument.
1787 * tests/mozilla/expected.html: Update results.
1789 2004-08-02 Darin Adler <darin@apple.com>
1791 * tests/mozilla/.cvsignore: Added.
1792 * tests/mozilla/expected.html: Update results.
1794 2004-08-02 Darin Adler <darin@apple.com>
1798 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1800 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1801 Append the flags here so more tests paseed.
1803 2004-08-02 Darin Adler <darin@apple.com>
1807 - fixed a couple things making 5 Mozilla regexp tests pass
1809 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1811 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1812 be used as the flags string when no parameter was passed.
1814 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1815 Added a class info object for RegExp prototype so it can return
1816 a string instead of raising an exception when converting to a string.
1818 * tests/mozilla/expected.html: Update results.
1820 2004-08-02 Darin Adler <darin@apple.com>
1824 - fix crashes in mozilla tests due to mishandling NaN
1826 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1827 calls to toInteger so that NaN will get turned into something that fits in an integer.
1828 These were the ones John already fixed, but his fix used isnan and the new fix is
1831 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1832 after a call to toInteger to handle NaN properly. Also removed separate check
1833 for undefined that's not needed.
1835 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1836 as in the above two files, but for a lot more functions. Also changed one place with
1837 an explicit check for undefined to instead just check isNaN.
1839 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1840 like me who don't keep $SYMROOTS in their $PATH.
1846 2004-07-26 Kevin Decker <kdecker@apple.com>
1848 Changes done by Darin, reviewed by Kevin.
1850 - changed testkjs to build in Xcode rather than from Makefile
1852 * .cvsignore: Removed obsolete files from this list.
1853 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1854 Changed to build target "All" rather than default target. This makes us
1855 build the testkjs test tool.
1856 * dummy.cpp: Removed.
1857 * kjs/.cvsignore: Removed obsolete files from this list, including
1858 the testkjs tool, which is now built in the symroots directory.
1859 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1860 changed this file. Also this has the nice side effect of causing the tool
1861 to be rebuilt in the new location even if there are no other changes in
1862 your tree when you check this out.
1863 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1864 without setting the execute bit on jsDriver.pl.
1866 2004-07-22 Kevin Decker <kdecker@apple.com>
1870 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1872 * kjs/function_object.cpp:
1873 (FunctionObjectImp::construct):
1874 * kjs/function_object.h:
1876 (KJS::ObjectImp::construct):
1878 (KJS::Object::construct):
1880 2004-07-21 Darin Adler <darin@apple.com>
1882 * bindings/npruntime.h: Fixed typo.
1884 2004-07-19 John Sullivan <sullivan@apple.com>
1888 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1889 vulnerability in my patch for 3714644
1891 * kjs/array_object.cpp:
1892 (ArrayProtoFuncImp::call):
1893 handle NAN parameters passed to slice() by clamping to 0 and length.
1895 2004-07-19 Richard Williamson <rjw@apple.com>
1897 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1902 * bindings/jni/jni_jsobject.cpp:
1904 (JSObject::JSObject):
1906 2004-07-16 John Sullivan <sullivan@apple.com>
1910 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1911 hangs browser with javascript
1913 * kjs/array_object.cpp:
1914 (ArrayProtoFuncImp::call):
1915 Check for undefined type for args[0] the same way we were already checking
1916 for args[1]. In this case, args was zero-length, but we were treating
1917 args[0] like an integer anyway. Resulted in some code looping from a NAN
1918 value to 4, taking approximately forever.
1920 * JavaScriptCore.pbproj/project.pbxproj:
1925 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1929 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1930 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1932 * kjs/number_object.cpp:
1933 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1935 2004-07-13 Kevin Decker <kdecker@apple.com>
1937 Reviewed by kocienda.
1939 - made testkjs and JavaScriptCore a subtarget of 'All'
1940 - testkjs now builds in $SYMROOTS
1942 * JavaScriptCore.pbproj/project.pbxproj:
1946 2004-06-24 Chris Blumenberg <cblu@apple.com>
1948 Ignore .mode1 files in JavaScriptCore.pbproj
1950 Reviewed by kocienda.
1952 * JavaScriptCore.pbproj/.cvsignore:
1954 2004-06-23 Richard Williamson <rjw@apple.com>
1956 Implemented changes for latest npruntime.h.
1960 * JavaScriptCore.pbproj/project.pbxproj:
1961 * bindings/NP_jsobject.cpp:
1962 (listFromVariantArgs):
1963 (identiferFromNPIdentifier):
1964 (_NPN_CreateScriptObject):
1969 (NPN_RemoveProperty):
1970 * bindings/NP_jsobject.h:
1971 * bindings/c/c_class.cpp:
1972 (CClass::methodsNamed):
1973 (CClass::fieldNamed):
1974 * bindings/c/c_instance.cpp:
1975 (CInstance::invokeMethod):
1976 * bindings/c/c_utility.cpp:
1977 (convertNPVariantToValue):
1978 * bindings/c/c_utility.h:
1979 * bindings/npruntime.cpp:
1980 (stringIdentifierEqual):
1981 (stringIdentifierHash):
1982 (getStringIdentifierDictionary):
1983 (intIdentifierEqual):
1984 (intIdentifierHash):
1985 (getIntIdentifierDictionary):
1986 (NPN_GetStringIdentifier):
1987 (NPN_GetStringIdentifiers):
1988 (NPN_GetIntIdentifier):
1989 (NPN_IdentifierIsString):
1990 (NPN_UTF8FromIdentifier):
1991 (NPN_VariantToInt32):
1992 (NPN_VariantToDouble):
1994 * bindings/npruntime.h:
1995 * bindings/objc/WebScriptObject.mm:
1996 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1997 * bindings/runtime_object.cpp:
1998 (RuntimeObjectImp::~RuntimeObjectImp):
1999 * bindings/runtime_root.cpp:
2000 (KJS::Bindings::rootForInterpreter):
2001 * bindings/testbindings.cpp:
2002 (initializeIdentifiers):
2008 === JavaScriptCore-146.1 ===
2010 2004-06-16 Richard Williamson <rjw@apple.com>
2012 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
2014 This turned out to be a show stopper for Dashboard. Accessing a nil
2015 ObjC property from JS caused a crash. Similar to the problem
2016 3696112 fixed below.
2020 * bindings/objc/objc_runtime.mm:
2021 (KJS::Bindings::ObjcField::valueFromInstance):
2025 2004-06-16 Richard Williamson <rjw@apple.com>
2027 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
2029 This turned out to be a show stopper for Dashboard. We now
2030 return Undefined() when nil is returned from a ObjC method
2031 that returns an object type.
2035 * bindings/objc/objc_utility.mm:
2036 (KJS::Bindings::convertObjcValueToValue):
2040 2004-06-15 Richard Williamson <rjw@apple.com>
2042 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
2044 No longer need to check respondsToSelector: for
2045 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
2046 because these now have a default implementation on NSObject.
2050 * bindings/objc/objc_class.mm:
2051 (ObjcClass::methodsNamed):
2052 (ObjcClass::fieldNamed):
2054 2004-06-14 Darin Adler <darin@apple.com>
2058 - fixed some things for GC that Patrick missed, or that happened after the branch
2060 * bindings/objc/WebScriptObject.mm:
2061 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
2062 (-[WebScriptObject finalize]): Added.
2064 - added some missing nil checks
2066 * bindings/objc/objc_instance.mm:
2067 (ObjcInstance::ObjcInstance): Check for nil.
2068 (ObjcInstance::~ObjcInstance): Check for nil.
2069 (ObjcInstance::operator=): Check for nil.
2071 2004-06-14 Darin Adler <darin@apple.com>
2073 Reviewed by me, code changes by Patrick Beard.
2075 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
2077 * bindings/objc/objc_instance.mm:
2078 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
2079 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
2080 (ObjcInstance::operator=): More of the same.
2081 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
2083 * bindings/objc/objc_runtime.mm:
2084 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
2085 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
2086 (ObjcArray::operator=): More of the same.
2088 * bindings/testbindings.mm: Fixed incorrect license.
2089 (main): Use [pool drain] if compiling on Tiger.
2093 2004-06-10 Kevin Decker <kdecker@apple.com>
2099 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2101 (KJS::Lexer::lineNo):
2102 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2104 === JavaScriptCore-143.2 ===
2106 2004-06-07 Darin Adler <darin@apple.com>
2108 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
2110 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
2111 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
2113 === JavaScriptCore-143.1 ===
2115 2004-06-04 Kevin Decker <kdecker@apple.com>
2119 - fixed <rdar://problem/3680594>
2122 (KJS::Error::create):
2126 2004-06-04 Darin Adler <darin@apple.com>
2128 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
2130 2004-06-04 Kevin Decker <kdecker@apple.com>
2134 - ObjC bindings do not (yet) pass along sourceurl or line numbers
2135 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
2136 - changed the wording of an error message
2137 - the lexer, parser, and interpreter have been made "sourceURL aware"
2138 - stored the url into Error
2140 * bindings/NP_jsobject.cpp:
2142 * bindings/jni/jni_jsobject.cpp:
2144 * bindings/objc/WebScriptObject.mm:
2145 (-[WebScriptObject evaluateWebScript:]):
2147 (GlobalFuncImp::call):
2148 * kjs/function_object.cpp:
2149 (FunctionObjectImp::construct):
2152 (InterpreterImp::checkSyntax):
2153 (InterpreterImp::evaluate):
2155 * kjs/interpreter.cpp:
2156 (Interpreter::evaluate):
2157 * kjs/interpreter.h:
2161 (KJS::Lexer::sourceURL):
2165 (FunctionCallNode::evaluate):
2168 (KJS::Error::create):
2171 2004-06-04 Richard Williamson <rjw@apple.com>
2173 Fixed crash when attempting to access properties on nil
2178 * bindings/objc/objc_instance.mm:
2179 (ObjcInstance::getClass):
2180 * bindings/runtime_object.cpp:
2181 (RuntimeObjectImp::get):
2182 * bindings/testM.js:
2183 * bindings/testbindings.mm:
2184 (-[MyFirstInterface getString]):
2186 2004-05-27 Kevin Decker <kdecker@apple.com>
2190 -revised generated error message content
2192 * kjs/error_object.cpp:
2193 (ErrorProtoFuncImp::call):
2197 (KJS::Error::create):
2201 2004-05-27 Richard Williamson <rjw@apple.com>
2203 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2207 * bindings/objc/WebScriptObject.h:
2209 2004-05-27 Darin Adler <darin@apple.com>
2213 - moved to new symlink technique for embedding frameworks
2215 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2216 because we don't need it any more.
2218 2004-05-24 Richard Williamson <rjw@apple.com>
2220 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2221 fixed ClassInfo to correctly reflect inheritance. This is required
2222 because of the runtime checks in JSC for arrays, i.e. in
2223 the Function objects apply method.
2227 * bindings/jni/jni_runtime.cpp:
2228 (JavaArray::convertJObjectToArray):
2229 * bindings/objc/objc_utility.mm:
2230 (KJS::Bindings::convertObjcValueToValue):
2231 * bindings/runtime_array.cpp:
2232 (RuntimeArrayImp::RuntimeArrayImp):
2233 * bindings/runtime_array.h:
2234 * bindings/testM.js: Added.
2235 * bindings/testbindings.mm:
2236 (+[MyFirstInterface webScriptNameForSelector:]):
2237 (-[MyFirstInterface logMessages:]):
2238 (-[MyFirstInterface logMessage:prefix:]):
2239 (-[MyFirstInterface callJSObject::]):
2241 2004-05-22 Darin Adler <darin@apple.com>
2245 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2247 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2248 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2249 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2250 it hasn't been set explicitly.
2254 2004-05-20 Richard Williamson <rjw@apple.com>
2256 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
2257 can now be referenced like any other WebScriptObject, meaning
2258 you can do JS operations on them.
2260 All added implementation of finalizeForWebScript.
2264 * bindings/objc/WebScriptObject.h:
2265 * bindings/objc/WebScriptObject.mm:
2266 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2267 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2268 (-[WebScriptObject KJS::]):
2269 (-[WebScriptObject dealloc]):
2270 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2271 (-[WebScriptObject evaluateWebScript:]):
2272 (-[WebScriptObject setValue:forKey:]):
2273 (-[WebScriptObject valueForKey:]):
2274 (-[WebScriptObject stringRepresentation]):
2275 * bindings/objc/WebScriptObjectPrivate.h:
2276 * bindings/objc/objc_instance.mm:
2277 (ObjcInstance::~ObjcInstance):
2279 2004-05-19 Richard Williamson <rjw@apple.com>
2281 Removed extraneous tabs that were added (by XCode?).
2283 * bindings/objc/WebScriptObject.h:
2285 2004-05-19 Darin Adler <darin@apple.com>
2287 - fixed headers with licenses mangled by Xcode auto-indenting
2289 * bindings/jni/jni_jsobject.cpp:
2290 * bindings/jni/jni_jsobject.h:
2291 * bindings/runtime_array.h:
2292 * bindings/runtime_root.cpp:
2293 * bindings/runtime_root.h:
2295 2004-05-18 Richard Williamson <rjw@apple.com>
2297 Added exception logging. Also check for exception and
2298 set results as appropriate.
2300 Reviewed by Maciej (partially reviewed).
2302 * bindings/objc/WebScriptObject.mm:
2303 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2304 (-[WebScriptObject evaluateWebScript:]):
2305 (-[WebScriptObject setValue:forKey:]):
2306 (-[WebScriptObject valueForKey:]):
2308 2004-05-18 Richard Williamson <rjw@apple.com>
2310 Finsished implementing support for windowScriptObject.
2311 Had to make WebScriptObjectPrivate.h accessible from
2316 * JavaScriptCore.pbproj/project.pbxproj:
2317 * bindings/objc/WebScriptObjectPrivate.h:
2319 2004-05-18 Richard Williamson <rjw@apple.com>
2321 Use KVC to set/get values instead of directly accessing
2326 * bindings/objc/WebScriptObject.mm:
2327 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2328 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2329 * bindings/objc/objc_runtime.mm:
2330 (ObjcField::valueFromInstance):
2331 (convertValueToObjcObject):
2332 (ObjcField::setValueToInstance):
2334 2004-05-17 Richard Williamson <rjw@apple.com>
2336 Implemented new API for WebScriptObject.
2338 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2339 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
2343 * JavaScriptCore.pbproj/project.pbxproj:
2344 * bindings/c/c_instance.cpp:
2345 (CInstance::invokeMethod):
2346 * bindings/jni/jni_instance.cpp:
2347 (JavaInstance::invokeMethod):
2348 * bindings/jni/jni_jsobject.cpp:
2349 (JSObject::convertValueToJObject):
2350 * bindings/jni/jni_utility.cpp:
2351 (KJS::Bindings::getJNIField):
2352 * bindings/objc/WebScriptObject.mm:
2354 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2355 (-[WebScriptObject KJS::]):
2356 (-[WebScriptObject dealloc]):
2357 (+[WebScriptObject throwException:]):
2359 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2360 (-[WebScriptObject evaluateWebScript:]):
2361 (-[WebScriptObject setValue:forKey:]):
2362 (-[WebScriptObject valueForKey:]):
2363 (-[WebScriptObject stringRepresentation]):
2364 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2365 (+[WebUndefined undefined]):
2366 (-[WebUndefined initWithCoder:]):
2367 (-[WebUndefined encodeWithCoder:]):
2368 (-[WebUndefined copyWithZone:]):
2369 (-[WebUndefined retain]):
2370 (-[WebUndefined release]):
2371 (-[WebUndefined retainCount]):
2372 (-[WebUndefined autorelease]):
2373 (-[WebUndefined dealloc]):
2374 (-[WebUndefined copy]):
2375 (-[WebUndefined replacementObjectForPortCoder:]):
2376 * bindings/objc/WebScriptObjectPrivate.h: Added.
2377 * bindings/objc/objc_class.mm:
2378 (ObjcClass::methodsNamed):
2379 (ObjcClass::fieldNamed):
2380 * bindings/objc/objc_instance.mm:
2381 (ObjcInstance::invokeMethod):
2382 * bindings/objc/objc_jsobject.h:
2383 * bindings/objc/objc_jsobject.mm:
2384 * bindings/objc/objc_runtime.mm:
2385 (ObjcField::valueFromInstance):
2386 * bindings/objc/objc_utility.mm:
2387 (KJS::Bindings::JSMethodNameToObjCMethodName):
2388 (KJS::Bindings::convertValueToObjcValue):
2389 (KJS::Bindings::convertObjcValueToValue):
2390 * bindings/runtime.cpp:
2391 (Instance::setDidExecuteFunction):
2392 (Instance::didExecuteFunction):
2393 (Instance::setValueOfField):
2394 * bindings/runtime.h:
2395 * bindings/testbindings.mm:
2396 (+[MyFirstInterface webScriptNameForSelector:]):
2397 (-[MyFirstInterface callJSObject::]):
2399 2004-05-14 Vicki Murley <vicki@apple.com>
2403 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2405 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2409 2004-05-13 Richard Williamson <rjw@apple.com>
2416 * bindings/objc/WebScriptObject.h:
2418 2004-05-13 Richard Williamson <rjw@apple.com>
2420 Approved API changes. Currently unimplemented.
2425 * JavaScriptCore.pbproj/project.pbxproj:
2426 * bindings/objc/WebScriptObject.h: Added.
2427 * bindings/objc/WebScriptObject.mm: Added.
2428 (+[WebScriptObject throwException:]):
2429 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2430 (-[WebScriptObject evaluateWebScript:]):
2431 (-[WebScriptObject stringRepresentation]):
2432 (+[WebUndefined undefined]):
2433 (-[WebUndefined initWithCoder:]):
2434 (-[WebUndefined encodeWithCoder:]):
2435 (-[WebUndefined copyWithZone:]):
2437 2004-05-07 Vicki Murley <vicki@apple.com>
2441 Turn off GC since it uses ppc only instructions (which breaks
2444 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2448 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2452 - add -funroll-loops=16 compiler option for approx .5% speedup on
2453 HTML iBench and .5-1% speedup on JS iBench.
2455 * JavaScriptCore.pbproj/project.pbxproj:
2457 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2461 Enable full conservative GC mode in addition to test mode. When
2462 conservative GC is enabled, we now get an 11% speed improvement on
2463 the iBench. Also fix some spots I missed before.
2465 Specific noteworth changes:
2467 * kjs/collector.cpp:
2468 (KJS::Collector::markStackObjectsConservatively): Check possible
2469 cell pointers for 8-byte aligment and verify they are not 0.
2471 * kjs/protected_values.cpp:
2472 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2473 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2475 (KJS::gcProtectNullTolerant): ...to here...
2476 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2477 tolerance, and doing the check is expensive.
2479 * kjs/protected_values.cpp:
2480 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2481 that is still very good.
2486 (KJS::ProtectedValue::ProtectedValue):
2487 (KJS::ProtectedValue::~ProtectedValue):
2488 (KJS::ProtectedValue::operator=):
2489 (KJS::ProtectedObject::ProtectedObject):
2490 (KJS::ProtectedObject::~ProtectedObject):
2491 (KJS::ProtectedObject::operator=):
2492 (KJS::ProtectedReference::ProtectedReference):
2493 (KJS::ProtectedReference::~ProtectedReference):
2494 (KJS::ProtectedReference::operator=):
2495 * kjs/protected_values.cpp:
2496 (KJS::ProtectedValues::getProtectCount):
2497 (KJS::ProtectedValues::increaseProtectCount):
2498 (KJS::ProtectedValues::decreaseProtectCount):
2499 (KJS::ProtectedValues::computeHash):
2500 * bindings/runtime_root.cpp:
2501 (KJS::Bindings::addNativeReference):
2502 (KJS::Bindings::removeNativeReference):
2503 (RootObject::removeAllNativeReferences):
2504 * bindings/runtime_root.h:
2505 (KJS::Bindings::RootObject::~RootObject):
2506 (KJS::Bindings::RootObject::setRootObjectImp):
2507 * kjs/collector.cpp:
2508 (KJS::Collector::allocate):
2509 (KJS::Collector::collect):
2512 (NumberImp::create):
2513 (InterpreterImp::globalInit):
2514 (InterpreterImp::globalClear):
2515 (InterpreterImp::mark):
2517 (KJS::List::derefValues):
2518 (KJS::List::refValues):
2519 (KJS::List::append):
2521 (KJS::ObjectImp::setInternalValue):
2522 (KJS::ObjectImp::putDirect):
2527 (KJS::ValueImp::ValueImp):
2528 (KJS::ValueImp::~ValueImp):
2530 (KJS::Value::Value):
2531 (KJS::Value::~Value):
2532 (KJS::Value::operator=):
2534 2004-04-30 Richard Williamson <rjw@apple.com>
2536 Asking an NSInvocation for it's return value when return type
2537 is void throws an exception. Added check for void return types
2538 to avoid this exception.
2542 * bindings/objc/objc_instance.mm:
2543 (ObjcInstance::invokeMethod):
2545 2004-04-29 Richard Williamson <rjw@apple.com>
2547 Fixed several bad problems with the ObjC bindings. In particular, conversion
2548 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2552 * bindings/objc/objc_jsobject.h:
2553 * bindings/objc/objc_jsobject.mm:
2554 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2555 (-[JavaScriptObject KJS::]):
2556 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2557 (-[JavaScriptObject call:arguments:]):
2558 (-[JavaScriptObject evaluate:]):
2559 (-[JavaScriptObject getMember:]):
2560 (-[JavaScriptObject getSlot:]):
2561 * bindings/objc/objc_runtime.mm:
2562 (ObjcField::valueFromInstance):
2563 (ObjcField::setValueToInstance):
2564 * bindings/objc/objc_utility.mm:
2565 (KJS::Bindings::convertValueToObjcValue):
2566 (KJS::Bindings::convertObjcValueToValue):
2567 * bindings/runtime.h:
2568 * bindings/runtime_root.cpp:
2569 (KJS::Bindings::rootForInterpreter):
2570 (KJS::Bindings::addNativeReference):
2571 (KJS::Bindings::removeNativeReference):
2572 * bindings/runtime_root.h:
2573 * bindings/testbindings.mm:
2574 (-[MyFirstInterface logMessage:]):
2575 (-[MyFirstInterface setJSObject:]):
2576 (-[MyFirstInterface callJSObject::]):
2578 2004-04-24 Darin Adler <darin@apple.com>
2582 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2585 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2589 Implementation of conservative GC, based partly on code from
2590 Darin. It's turned off for now, so it shouldn't have any effect on
2593 * JavaScriptCore.pbproj/project.pbxproj:
2594 * kjs/collector.cpp:
2595 (KJS::Collector::markStackObjectsConservatively):
2596 (KJS::Collector::markProtectedObjects):
2597 (KJS::Collector::collect):
2602 * kjs/protected_values.cpp: Added.
2603 (KJS::ProtectedValues::getProtectCount):
2604 (KJS::ProtectedValues::increaseProtectCount):
2605 (KJS::ProtectedValues::insert):
2606 (KJS::ProtectedValues::decreaseProtectCount):
2607 (KJS::ProtectedValues::expand):
2608 (KJS::ProtectedValues::shrink):
2609 (KJS::ProtectedValues::rehash):
2610 (KJS::ProtectedValues::computeHash):
2611 * kjs/protected_values.h: Added.
2613 (ValueImp::useConservativeMark):
2621 2004-04-22 Richard Williamson <rjw@apple.com>
2623 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2626 * bindings/npruntime.h:
2628 2004-04-22 Richard Williamson <rjw@apple.com>
2630 Updated plugin binding API to reflect latest revision from
2633 Biggest change is the introduction of NPVariant used to represent
2634 value types. NPVariant replaces the use of NPObject for the
2635 exchange of values between scripting environment and native code.
2639 * JavaScriptCore.pbproj/project.pbxproj:
2640 * bindings/NP_jsobject.cpp:
2641 (identiferFromNPIdentifier):
2647 (NPN_GetPropertyAtIndex):
2648 (NPN_SetPropertyAtIndex):
2649 * bindings/c/c_class.cpp:
2650 (CClass::methodsNamed):
2651 (CClass::fieldNamed):
2652 * bindings/c/c_instance.cpp:
2653 (CInstance::invokeMethod):
2654 (CInstance::defaultValue):
2655 * bindings/c/c_runtime.cpp:
2656 (CField::valueFromInstance):
2657 (CField::setValueToInstance):
2658 * bindings/c/c_utility.cpp:
2659 (convertNPStringToUTF16):
2660 (convertUTF8ToUTF16):
2661 (coerceValueToNPVariantStringType):
2662 (convertValueToNPVariant):
2663 (convertNPVariantToValue):
2664 * bindings/c/c_utility.h:
2665 * bindings/npruntime.cpp:
2666 (NPN_GetIdentifier):
2667 (NPN_GetIdentifiers):
2668 (NPN_UTF8FromIdentifier):
2669 (NPN_VariantIsVoid):
2670 (NPN_VariantIsNull):
2671 (NPN_VariantIsUndefined):
2672 (NPN_VariantIsBool):
2673 (NPN_VariantIsInt32):
2674 (NPN_VariantIsDouble):
2675 (NPN_VariantIsString):
2676 (NPN_VariantIsObject):
2677 (NPN_VariantToBool):
2678 (NPN_VariantToString):
2679 (NPN_VariantToInt32):
2680 (NPN_VariantToDouble):
2681 (NPN_VariantToObject):
2682 (NPN_InitializeVariantAsVoid):
2683 (NPN_InitializeVariantAsNull):
2684 (NPN_InitializeVariantAsUndefined):
2685 (NPN_InitializeVariantWithBool):
2686 (NPN_InitializeVariantWithInt32):
2687 (NPN_InitializeVariantWithDouble):
2688 (NPN_InitializeVariantWithString):
2689 (NPN_InitializeVariantWithStringCopy):
2690 (NPN_InitializeVariantWithObject):
2691 (NPN_InitializeVariantWithVariant):
2692 (NPN_ReleaseVariantValue):
2695 (NPN_ReleaseObject):
2696 (NPN_IsKindOfClass):
2697 (NPN_SetExceptionWithUTF8):
2699 * bindings/npruntime.h:
2701 (_NPString::_NPVariant::):
2702 * bindings/testbindings.cpp:
2717 2004-04-22 Darin Adler <darin@apple.com>
2721 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2724 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2725 Was resulting in a buffer 2x the needed size.
2726 (KJS::UString::expandPreCapacity): Ditto.
2727 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2729 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2733 Preliminary change for conservative GC. Create "protected"
2734 subclasses to GC-protect objects when on heap, since we will soon
2735 remove the built-in refcounting of the normal wrapper classes. Use
2738 * JavaScriptCore.pbproj/project.pbxproj:
2741 (KJS::InterpreterImp::globalObject):
2742 * kjs/interpreter.h:
2743 * kjs/property_map.cpp:
2745 * kjs/reference_list.cpp:
2747 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2751 Optimize prepend using the shared substring optimization. Also,
2752 limit the applicability of shared append and shared prepend. If
2753 you overdo it, it does more harm than good, because you create a
2754 bunch of strings that are disqualified from future shared
2755 append/prepend, for not much immediate savings in allocate/copy
2760 (KJS::UString::Rep::create):
2761 (KJS::UString::expandedSize):
2762 (KJS::UString::usedPreCapacity):
2763 (KJS::UString::expandCapacity):
2764 (KJS::UString::expandPreCapacity):
2765 (KJS::UString::UString):
2766 (KJS::UString::append):
2767 (KJS::UString::operator=):
2769 (KJS::UString::Rep::data):
2771 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2772 Reviewed by Richard.
2774 No more need for Completion or Reference to privately inherit from
2775 Value, none of the superclass functionality is used.
2782 2004-04-16 Richard Williamson <rjw@apple.com>
2784 Added interpreter lock protection around object creation.
2788 * bindings/runtime.cpp:
2789 (Instance::createRuntimeObject):
2791 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2795 Another JavaScript speed improvement: use the mechanism from
2796 string append optimization to make taking a substring fast, again
2799 A further 22% improvement on the 24fun string speed test.
2803 (KJS::UString::Rep::create):
2804 (KJS::UString::UString):
2805 (KJS::UString::append):
2806 (KJS::UString::operator=):
2807 (KJS::UString::substr):
2809 (KJS::UString::Rep::data):
2811 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2815 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2816 - fixed <rdar://problem/3600691>: Table generation test is really slow
2817 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2819 80% speedup on the string test, lesser speedups on the other two.
2821 Two different optimizations here:
2823 1) Avoid large overhead of scanning strings to see if they are all
2824 ASCII before numeric conversion.
2827 (AssignNode::evaluate): Don't convert to integer until we know for
2828 sure the operation will need it. Attempting to convert strings to
2829 numbers is a waste when they are being appended with +=.
2831 2) Avoid huge cost of appending strings.
2833 This is done by allowing multiple strings to share a buffer but
2834 actually use different ranges of it. The first time a string is
2835 appended to, we start leaving at least 10% extra space in the
2836 buffer, so doing N appends to the same string takes O(log N)
2837 mallocs instead of O(N).
2839 * kjs/identifier.cpp:
2840 (KJS::Identifier::equal):
2841 (KJS::Identifier::add):
2844 (KJS::UCharReference::operator=):
2845 (KJS::UCharReference::ref):
2846 (KJS::UString::Rep::create):
2847 (KJS::UString::Rep::destroy):
2848 (KJS::UString::expandedSize):
2849 (KJS::UString::usedCapacity):
2850 (KJS::UString::expandCapacity):
2851 (KJS::UString::UString):
2852 (KJS::UString::null):
2853 (KJS::UString::append):
2854 (KJS::UString::operator=):
2855 (KJS::UString::toStrictUInt32):
2856 (KJS::UString::detach):
2857 (KJS::KJS::operator==):
2859 (KJS::UString::Rep::data):
2860 (KJS::UString::Rep::hash):
2862 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2866 - fix deployment build by avoiding deployment-only warning.
2868 * kjs/scope_chain.cpp:
2869 (KJS::ScopeChain::bottom):
2871 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2875 Changed things so that newly created objects get a prototype based
2876 on the scope chain of the current function, rather than the
2877 interpreter that started execution. This fixes the following bugs:
2879 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2880 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2882 * JavaScriptCore.pbproj/project.pbxproj:
2883 * kjs/array_object.cpp:
2884 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2885 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2886 (ArrayProtoFuncImp::call):
2887 (ArrayObjectImp::construct):
2888 * kjs/bool_object.cpp:
2889 (BooleanObjectImp::construct):
2890 * kjs/date_object.cpp:
2891 (DateProtoFuncImp::DateProtoFuncImp):
2892 (DateProtoFuncImp::call):
2893 (DateObjectImp::construct):
2894 * kjs/error_object.cpp:
2895 (ErrorObjectImp::construct):
2897 (FunctionImp::FunctionImp):
2898 (FunctionImp::call):
2899 (DeclaredFunctionImp::construct):
2900 (ArgumentsImp::ArgumentsImp):
2901 (GlobalFuncImp::call):
2902 * kjs/function_object.cpp:
2903 (FunctionProtoFuncImp::call):
2904 (FunctionObjectImp::construct):
2906 (BooleanImp::toObject):
2907 (StringImp::toObject):
2908 (NumberImp::toObject):
2909 (InterpreterImp::InterpreterImp):
2910 (InterpreterImp::clear):
2911 (InterpreterImp::interpreterWithGlobalObject):
2913 * kjs/interpreter.cpp:
2914 (ExecState::lexicalInterpreter):
2915 * kjs/interpreter.h:
2916 (KJS::ExecState::dynamicInterpreter):
2917 (KJS::ExecState::interpreter):
2918 * kjs/math_object.cpp:
2919 (MathFuncImp::MathFuncImp):
2921 (StatementNode::hitStatement):
2922 (StatementNode::abortStatement):
2923 (RegExpNode::evaluate):
2924 (ElementNode::evaluate):
2925 (ArrayNode::evaluate):
2926 (ObjectLiteralNode::evaluate):
2927 (PropertyValueNode::evaluate):
2928 (FunctionCallNode::evaluate):
2929 (FuncDeclNode::processFuncDecl):
2930 (FuncExprNode::evaluate):
2931 * kjs/number_object.cpp:
2932 (NumberObjectImp::construct):
2934 (KJS::ObjectImp::defaultValue):
2935 (KJS::Error::create):
2936 * kjs/object_object.cpp:
2937 (ObjectObjectImp::construct):
2938 * kjs/reference.cpp:
2939 (Reference::putValue):
2940 * kjs/regexp_object.cpp:
2941 (RegExpProtoFuncImp::call):
2942 (RegExpObjectImp::arrayOfMatches):
2943 (RegExpObjectImp::construct):
2944 * kjs/scope_chain.cpp:
2945 (KJS::ScopeChain::bottom):
2946 * kjs/scope_chain.h:
2947 * kjs/string_object.cpp:
2948 (StringProtoFuncImp::StringProtoFuncImp):
2949 (StringProtoFuncImp::call):
2950 (StringObjectImp::construct):
2956 2004-03-31 Richard Williamson <rjw@apple.com>
2958 Tedious renames based on feedback from plugin-futures list.
2959 NP_ functions are renamed with NPN_ prefix.
2960 Types prefix renamed from NP_ to NP.
2961 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2963 No review because this was just a renaming patch.
2965 * bindings/NP_jsobject.cpp:
2968 (identiferFromNPIdentifier):
2973 (NPN_RemoveProperty):
2975 (NPN_GetPropertyAtIndex):
2976 (NPN_SetPropertyAtIndex):
2977 * bindings/NP_jsobject.h:
2978 * bindings/c/c_class.cpp:
2979 (CClass::_commonInit):
2980 (CClass::classForIsA):
2982 (CClass::methodsNamed):
2983 (CClass::fieldNamed):
2984 * bindings/c/c_class.h:
2985 * bindings/c/c_instance.cpp:
2986 (CInstance::CInstance):
2987 (CInstance::~CInstance):
2988 (CInstance::operator=):
2989 (CInstance::invokeMethod):
2990 (CInstance::defaultValue):
2991 * bindings/c/c_instance.h:
2992 (KJS::Bindings::CInstance::getObject):
2993 * bindings/c/c_runtime.cpp:
2994 (CField::valueFromInstance):
2995 (CField::setValueToInstance):
2996 * bindings/c/c_runtime.h:
2997 (KJS::Bindings::CField::CField):
2998 (KJS::Bindings::CField::name):
2999 (KJS::Bindings::CMethod::CMethod):
3000 (KJS::Bindings::CMethod::name):
3001 * bindings/c/c_utility.cpp:
3002 (coerceValueToNPString):
3003 (convertValueToNPValueType):
3004 (convertNPValueTypeToValue):
3005 * bindings/c/c_utility.h:
3006 * bindings/npruntime.cpp:
3007 (NPN_IdentifierFromUTF8):
3008 (NPN_IsValidIdentifier):
3009 (NPN_GetIdentifiers):
3010 (NPN_UTF8FromIdentifier):
3013 (NPN_ReleaseObject):
3014 (NPN_IsKindOfClass):
3015 (NPN_SetExceptionWithUTF8):
3018 (NPN_CreateNumberWithInt):
3019 (NPN_CreateNumberWithFloat):
3020 (NPN_CreateNumberWithDouble):
3021 (NPN_IntFromNumber):
3022 (NPN_FloatFromNumber):
3023 (NPN_DoubleFromNumber):
3025 (NPN_CreateStringWithUTF8):
3026 (NPN_CreateStringWithUTF16):
3027 (NPN_DeallocateUTF8):
3028 (NPN_UTF8FromString):
3029 (NPN_UTF16FromString):
3032 (NPN_CreateBoolean):
3033 (NPN_BoolFromBoolean):
3036 (undefinedAllocate):
3042 (NPN_ObjectAtIndex):
3043 * bindings/npruntime.h:
3044 * bindings/runtime.cpp:
3045 (Instance::createBindingForLanguageInstance):
3046 * bindings/testbindings.cpp:
3047 (initializeIdentifiers):
3067 2004-03-31 Richard Williamson <rjw@apple.com>
3069 Changed references to NP_runtime.h to npruntime.h
3071 * JavaScriptCore.pbproj/project.pbxproj:
3072 * bindings/NP_jsobject.h:
3073 * bindings/c/c_class.h:
3074 * bindings/c/c_instance.h:
3075 * bindings/c/c_runtime.h:
3076 * bindings/c/c_utility.h:
3077 * bindings/npruntime.cpp:
3079 2004-03-31 Richard Williamson <rjw@apple.com>
3081 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
3083 * JavaScriptCore.pbproj/project.pbxproj:
3084 * bindings/NP_jsobject.h:
3085 * bindings/npruntime.cpp:
3089 2004-03-23 Richard Williamson <rjw@apple.com>
3091 Added implementation of KJS::Value <-> NP_Object conversion functions.
3092 Augmented test program for 'C' bindings.
3093 Added asserts and parameter checking to all public API.
3097 * JavaScriptCore.pbproj/project.pbxproj:
3098 * bindings/NP_jsobject.cpp:
3100 * bindings/NP_jsobject.h: Added.
3101 * bindings/NP_runtime.cpp:
3102 (NP_IdentifierFromUTF8):
3103 (NP_IsValidIdentifier):
3104 (NP_GetIdentifiers):
3109 (NP_SetExceptionWithUTF8):
3112 (NP_FloatFromNumber):
3113 (NP_DoubleFromNumber):
3114 (NP_CreateStringWithUTF8):
3115 (NP_CreateStringWithUTF16):
3116 (NP_DeallocateUTF8):
3117 (NP_UTF8FromString):
3118 (NP_UTF16FromString):
3120 (NP_BoolFromBoolean):
3121 * bindings/NP_runtime.h:
3122 * bindings/c/c_instance.cpp:
3123 (CInstance::invokeMethod):
3124 * bindings/c/c_utility.cpp:
3125 (coerceValueToNPString):
3126 (convertValueToNPValueType):
3127 (convertNPValueTypeToValue):
3128 * bindings/c/c_utility.h:
3130 * bindings/testC.js: Added.
3131 * bindings/testbindings.cpp:
3141 (myInterfaceInvoke):
3142 (myInterfaceAllocate):
3146 2004-03-19 Darin Adler <darin@apple.com>
3150 - fixed problem with methods like setUTCHour
3152 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
3153 GMT vs. local time function based on the utc flag.
3155 2004-03-17 Richard Williamson <rjw@apple.com>
3157 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
3161 * bindings/NP_jsobject.cpp:
3166 (NP_GetPropertyAtIndex):
3167 * bindings/NP_runtime.h:
3169 2004-03-16 Richard Williamson <rjw@apple.com>
3171 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.
3175 * bindings/jni/jni_class.cpp:
3176 (JavaClass::methodsNamed):
3178 2004-03-15 Richard Williamson <rjw@apple.com>
3180 Fixed 3570854. Don't attempt to convert Null to strings. We
3181 were incorrectly converting to "Null".
3183 Actually fixed by Scott Kovatch.
3185 Reviewed by Richard.
3187 * bindings/jni/jni_utility.cpp:
3188 (KJS::Bindings::convertValueToJValue):
3192 2004-03-11 Richard Williamson <rjw@apple.com>
3194 Stitched together the NP stuff to our language independent
3195 JavaScript binding stuff. Very close to being done.
3197 Added program to test C bindings (and NP stuff). Just tests
3198 properties. Will add methods and JavaScript access, etc.
3200 Updated Makefile.am to account for new bindings/c directory.
3202 Change NP_UTF8 from "const char *" to "char" to allow for
3203 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
3206 Added NP_IsValidIdentifier().
3210 * JavaScriptCore.pbproj/project.pbxproj:
3212 * bindings/NP_jsobject.cpp:
3213 (identiferFromNPIdentifier):
3215 * bindings/NP_runtime.cpp:
3216 (NP_IdentifierFromUTF8):
3217 (NP_IsValidIdentifier):
3218 (NP_GetIdentifiers):
3219 (NP_UTF8FromIdentifier):
3220 (NP_SetExceptionWithUTF8):
3222 (NP_CreateStringWithUTF8):
3223 (NP_CreateStringWithUTF16):
3224 (NP_UTF8FromString):
3225 (NP_UTF16FromString):
3226 * bindings/NP_runtime.h:
3227 * bindings/c/c_class.cpp: Added.
3228 (CClass::_commonDelete):
3229 (CClass::_commonCopy):
3230 (CClass::_commonInit):
3231 (_createClassesByIsAIfNecessary):
3232 (CClass::classForIsA):
3235 (CClass::methodsNamed):
3236 (CClass::fieldNamed):
3237 * bindings/c/c_class.h: Added.
3238 (KJS::Bindings::CClass::~CClass):
3239 (KJS::Bindings::CClass::CClass):
3240 (KJS::Bindings::CClass::operator=):
3241 (KJS::Bindings::CClass::constructorAt):
3242 (KJS::Bindings::CClass::numConstructors):
3243 * bindings/c/c_instance.cpp: Added.
3244 (CInstance::CInstance):
3245 (CInstance::~CInstance):
3246 (CInstance::operator=):
3247 (CInstance::getClass):
3250 (CInstance::invokeMethod):
3251 (CInstance::defaultValue):
3252 (CInstance::stringValue):
3253 (CInstance::numberValue):
3254 (CInstance::booleanValue):
3255 (CInstance::valueOf):
3256 * bindings/c/c_instance.h: Added.
3257 (KJS::Bindings::CInstance::getObject):
3258 * bindings/c/c_runtime.cpp: Added.
3259 (CField::valueFromInstance):
3260 (CField::setValueToInstance):
3261 * bindings/c/c_runtime.h: Added.
3262 (KJS::Bindings::CField::CField):
3263 (KJS::Bindings::CField::name):
3264 (KJS::Bindings::CField::type):
3265 (KJS::Bindings::CMethod::CMethod):
3266 (KJS::Bindings::CMethod::name):
3267 (KJS::Bindings::CMethod::numParameters):
3268 * bindings/c/c_utility.cpp: Added.
3269 (coerceValueToNPValueType):
3270 (convertValueToNPValueType):
3271 (convertNPValueTypeToValue):
3272 * bindings/c/c_utility.h: Added.
3273 * bindings/make_testbindings:
3274 * bindings/runtime.cpp:
3275 (Instance::createBindingForLanguageInstance):
3276 * bindings/runtime.h:
3277 (KJS::Bindings::Instance::):
3278 * bindings/testbindings.cpp: Added.
3279 (initializeIdentifiers):
3280 (myInterfaceHasProperty):
3281 (myInterfaceHasMethod):
3282 (myInterfaceGetProperty):
3283 (myInterfaceSetProperty):
3284 (myInterfaceInvoke):
3285 (myInterfaceAllocate):
3286 (myInterfaceInvalidate):
3287 (myInterfaceDeallocate):
3288 (GlobalImp::className):
3289 (readJavaScriptFromFile):
3292 2004-03-10 Richard Williamson <rjw@apple.com>
3294 Made changes to support new asychronous approach to calls from
3295 plugin to JavaScript
3299 * bindings/NP_jsobject.cpp:
3304 (NP_GetPropertyAtIndex):
3305 * bindings/NP_runtime.h:
3306 * bindings/make_testbindings:
3307 * bindings/runtime.cpp:
3308 (Instance::createBindingForLanguageInstance):
3310 2004-03-10 Richard Williamson <rjw@apple.com>
3312 Updated header to include proposed changes from
3313 plugin-futures list. Calls from plugin to JavaScript
3314 are now asynchronous.
3318 * bindings/NP_runtime.h:
3322 2004-03-04 Richard Williamson <rjw@apple.com>
3324 Implementation of NP_JavaScriptObject. This is the 'C' class
3325 that wraps a JavaScript object.
3329 * JavaScriptCore.pbproj/project.pbxproj:
3330 * bindings/NP_jsobject.cpp: Added.
3331 (coerceValueToNPValueType):
3332 (convertValueToNPValueType):
3333 (convertNPValueTypeToValue):
3337 (identiferFromNPIdentifier):
3342 (NP_RemoveProperty):
3344 (NP_GetPropertyAtIndex):
3345 (NP_SetPropertyAtIndex):
3346 * bindings/NP_runtime.cpp:
3348 * bindings/NP_runtime.h:
3349 * bindings/runtime_object.h:
3351 2004-03-04 Richard Williamson <rjw@apple.com>
3353 Added NP_Array implementation.
3355 Changed NP_Boolean to just depend on two static instances, no
3356 space is required for values.
3360 * bindings/NP_runtime.cpp:
3362 (NP_BoolFromBoolean):
3368 * bindings/NP_runtime.h:
3370 2004-03-03 Darin Adler <darin@apple.com>
3374 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3375 copyright string, and that's all that was in here.
3376 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3378 2004-03-03 Richard Williamson <rjw@apple.com>
3380 More 'C' binding implementation. Fleshed out all the
3381 'primitive' data types.
3385 * bindings/NP_runtime.cpp:
3390 (NP_CreateStringWithUTF8):
3391 (NP_CreateStringWithUTF16):
3392 (NP_UTF8FromString):
3393 (NP_UTF16FromString):
3396 (booleanDeallocate):
3398 (NP_BoolFromBoolean):
3402 (undefinedAllocate):
3403 (undefinedDeallocate):
3405 * bindings/NP_runtime.h:
3407 2004-03-03 Richard Williamson <rjw@apple.com>
3409 More 'C' binding implementation.
3413 * bindings/NP_runtime.cpp:
3416 (getIdentifierDictionary):
3417 (NP_IdentifierFromUTF8):
3418 (NP_UTF8FromIdentifier):
3423 (NP_CreateNumberWithInt):
3424 (NP_CreateNumberWithFloat):
3425 (NP_CreateNumberWithDouble):
3427 (NP_FloatFromNumber):
3428 (NP_DoubleFromNumber):
3429 * bindings/NP_runtime.h:
3431 2004-03-02 Richard Williamson <rjw@apple.com>
3433 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3434 own customer retain/release scheme.
3438 * bindings/NP_runtime.cpp:
3441 * bindings/NP_runtime.h:
3443 2004-03-02 Richard Williamson <rjw@apple.com>
3445 C binding API. Partial implementation.
3447 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.
3449 Factored root object reference counting scheme. It is now useful independent
3454 * JavaScriptCore.pbproj/project.pbxproj:
3455 * bindings/NP_runtime.cpp: Added.
3456 (NP_IdentifierFromUTF8):
3457 (NP_GetIdentifiers):
3458 (NP_UTF8FromIdentifier):
3468 (NP_RemoveProperty):
3470 (NP_GetPropertyAtIndex):
3471 (NP_SetPropertyAtIndex):
3472 (NP_CreateNumberWithInt):
3473 (NP_CreateNumberWithFloat):
3474 (NP_CreateNumberWithDouble):
3476 (NP_FloatFromNumber):
3477 (NP_DoubleFromNumber):
3478 (NP_CreateStringWithUTF8):
3479 (NP_CreateStringWithUTF16):
3480 (NP_UTF8FromString):
3481 (NP_UTF16FromString):
3483 (NP_BoolFromBoolean):
3489 * bindings/NP_runtime.h: Added.
3490 * bindings/jni/jni_jsobject.cpp:
3492 (JSObject::finalize):
3493 (JSObject::createNative):
3494 (JSObject::convertValueToJObject):
3495 * bindings/jni/jni_jsobject.h:
3496 * bindings/objc/objc_jsobject.h:
3497 * bindings/objc/objc_jsobject.mm:
3499 (windowJavaScriptObject):
3500 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3501 (-[JavaScriptObject dealloc]):
3502 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3503 (-[JavaScriptObject call:arguments:]):
3504 (-[JavaScriptObject evaluate:]):
3505 (-[JavaScriptObject getMember:]):
3506 (-[JavaScriptObject setMember:value:]):
3507 (-[JavaScriptObject removeMember:]):
3508 (-[JavaScriptObject toString]):
3509 (-[JavaScriptObject getSlot:]):
3510 (-[JavaScriptObject setSlot:value:]):
3511 * bindings/objc/objc_utility.h:
3512 * bindings/objc/objc_utility.mm:
3513 (KJS::Bindings::convertValueToObjcValue):
3514 * bindings/runtime_root.cpp: Added.
3515 (getReferencesByRootDictionary):
3516 (getReferencesDictionary):
3517 (KJS::Bindings::findReferenceDictionary):
3518 (KJS::Bindings::rootForImp):
3519 (KJS::Bindings::addNativeReference):
3520 (KJS::Bindings::removeNativeReference):
3521 (completedJavaScriptAccess):
3522 (initializeJavaScriptAccessLock):
3523 (lockJavaScriptAccess):
3524 (unlockJavaScriptAccess):
3525 (RootObject::dispatchToJavaScriptThread):
3526 (performJavaScriptAccess):
3527 (RootObject::setFindRootObjectForNativeHandleFunction):
3528 (RootObject::removeAllNativeReferences):
3529 * bindings/runtime_root.h: Added.
3530 (KJS::Bindings::RootObject::RootObject):
3531 (KJS::Bindings::RootObject::~RootObject):
3532 (KJS::Bindings::RootObject::setRootObjectImp):
3533 (KJS::Bindings::RootObject::rootObjectImp):
3534 (KJS::Bindings::RootObject::setInterpreter):
3535 (KJS::Bindings::RootObject::interpreter):
3536 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3537 (KJS::Bindings::RootObject::runLoop):
3538 (KJS::Bindings::RootObject::performJavaScriptSource):
3544 2004-02-18 Richard Williamson <rjw@apple.com>
3546 Added NSNumber/Number conversion.
3548 Removed some unnecessary KJS:: namespace specifiers.
3552 * bindings/objc/objc_utility.mm:
3553 (KJS::Bindings::convertValueToObjcValue):
3554 (KJS::Bindings::convertObjcValueToValue):
3555 * bindings/runtime_array.h:
3557 2004-02-18 Richard Williamson <rjw@apple.com>
3559 Added support for export NSArrays.
3561 Updated valueAt() to take an ExecState so we can throw
3564 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
3565 ObjectiveC classes to control the visibility of their methods in
3570 * bindings/jni/jni_runtime.cpp:
3571 (JavaField::valueFromInstance):
3572 (JavaArray::valueAt):
3573 * bindings/jni/jni_runtime.h:
3574 * bindings/objc/objc_class.mm:
3575 (ObjcClass::methodsNamed):
3576 * bindings/objc/objc_runtime.h:
3577 (KJS::Bindings::ObjcArray::getObjcArray):
3578 * bindings/objc/objc_runtime.mm:
3579 (ObjcField::valueFromInstance):
3580 (ObjcField::setValueToInstance):
3581 (ObjcArray::ObjcArray):
3582 (ObjcArray::~ObjcArray):
3583 (ObjcArray::operator=):
3584 (ObjcArray::setValueAt):
3585 (ObjcArray::valueAt):
3586 (ObjcArray::getLength):
3587 * bindings/objc/objc_utility.mm:
3588 (KJS::Bindings::convertValueToObjcValue):
3589 (KJS::Bindings::convertObjcValueToValue):
3590 * bindings/runtime.cpp:
3591 (Instance::getValueOfField):
3592 * bindings/runtime.h:
3593 * bindings/runtime_array.cpp:
3594 (RuntimeArrayImp::get):
3595 * bindings/runtime_object.cpp:
3596 (RuntimeObjectImp::get):
3598 2004-02-17 Richard Williamson <rjw@apple.com>
3600 Added String <-> NSString conversion.
3601 Added tests of String <-> NSString conversion to test program.
3605 * bindings/objc/objc_utility.mm:
3606 (KJS::Bindings::convertValueToObjcValue):
3607 (KJS::Bindings::convertObjcValueToValue):
3609 * bindings/testbindings.mm:
3610 (-[MyFirstInterface getString]):
3612 2004-02-15 Darin Adler <darin@apple.com>
3616 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3617 and removing redundant settings of things that match defaults in other build styles.
3619 2004-02-13 Richard Williamson <rjw@apple.com>
3621 Work towards the JavaScript ObjC bindings. The bindings now work for
3622 simple scalar types. testbindings.mm is an illustration of how the
3627 * JavaScriptCore.pbproj/project.pbxproj:
3629 * bindings/jni/jni_class.cpp:
3630 (JavaClass::methodsNamed):
3631 * bindings/jni/jni_class.h:
3632 * bindings/jni/jni_instance.cpp:
3633 (JavaInstance::invokeMethod):
3634 * bindings/jni/jni_instance.h:
3635 * bindings/jni/jni_runtime.h:
3636 (KJS::Bindings::JavaMethod::returnType):
3637 * bindings/make_testbindings: Added.
3638 * bindings/objc/objc_class.h: Added.
3639 (KJS::Bindings::ObjcClass::~ObjcClass):
3640 (KJS::Bindings::ObjcClass::ObjcClass):
3641 (KJS::Bindings::ObjcClass::operator=):
3642 (KJS::Bindings::ObjcClass::constructorAt):
3643 (KJS::Bindings::ObjcClass::numConstructors):
3644 * bindings/objc/objc_class.mm: Added.
3645 (ObjcClass::_commonDelete):
3646 (ObjcClass::_commonCopy):
3647 (ObjcClass::_commonInit):
3648 (_createClassesByIsAIfNecessary):
3649 (ObjcClass::classForIsA):
3650 (ObjcClass::ObjcClass):
3652 (ObjcClass::methodsNamed):
3653 (ObjcClass::fieldNamed):
3654 * bindings/objc/objc_header.h: Added.
3655 * bindings/objc/objc_instance.h: Added.
3656 (KJS::Bindings::ObjcInstance::getObject):
3657 * bindings/objc/objc_instance.mm: Added.
3658 (ObjcInstance::ObjcInstance):
3659 (ObjcInstance::~ObjcInstance):
3660 (ObjcInstance::operator=):
3661 (ObjcInstance::begin):
3662 (ObjcInstance::end):
3663 (ObjcInstance::getClass):
3664 (ObjcInstance::invokeMethod):
3665 (ObjcInstance::defaultValue):
3666 (ObjcInstance::stringValue):
3667 (ObjcInstance::numberValue):
3668 (ObjcInstance::booleanValue):
3669 (ObjcInstance::valueOf):
3670 * bindings/objc/objc_jsobject.h: Added.
3671 * bindings/objc/objc_jsobject.mm: Added.
3672 * bindings/objc/objc_runtime.h:
3673 (KJS::Bindings::ObjcField::~ObjcField):
3674 (KJS::Bindings::ObjcField::ObjcField):
3675 (KJS::Bindings::ObjcField::operator=):
3676 (KJS::Bindings::ObjcMethod::ObjcMethod):
3677 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3678 (KJS::Bindings::ObjcMethod::operator=):
3679 * bindings/objc/objc_runtime.mm: Added.
3680 (ObjcMethod::ObjcMethod):
3682 (ObjcMethod::numParameters):
3683 (ObjcMethod::getMethodSignature):
3684 (ObjcField::ObjcField):
3687 (ObjcField::valueFromInstance):
3688 (ObjcField::setValueToInstance):
3689 * bindings/objc/objc_utility.h: Added.
3691 * bindings/objc/objc_utility.mm: Added.
3692 (KJS::Bindings::JSMethodNameToObjCMethodName):
3693 (KJS::Bindings::convertValueToObjcValue):
3694 (KJS::Bindings::convertObjcValueToValue):
3695 (KJS::Bindings::objcValueTypeForType):
3696 * bindings/runtime.cpp:
3697 (MethodList::MethodList):
3698 (MethodList::operator=):
3699 (Instance::setValueOfField):
3700 (Instance::createBindingForLanguageInstance):
3701 (Instance::createRuntimeObject):
3702 * bindings/runtime.h:
3703 * bindings/runtime_method.cpp:
3704 (RuntimeMethodImp::RuntimeMethodImp):
3705 (RuntimeMethodImp::get):
3706 (RuntimeMethodImp::call):
3707 * bindings/runtime_method.h:
3708 * bindings/runtime_object.cpp:
3709 (RuntimeObjectImp::get):
3710 (RuntimeObjectImp::hasProperty):
3711 * bindings/test.js: Added.
3712 * bindings/testbindings.mm: Added.
3713 (-[MySecondInterface init]):
3714 (-[MyFirstInterface init]):
3715 (-[MyFirstInterface dealloc]):
3716 (+[MyFirstInterface JavaScriptNameForSelector:]):
3717 (-[MyFirstInterface getInt]):
3718 (-[MyFirstInterface setInt:]):
3719 (-[MyFirstInterface getMySecondInterface]):
3720 (-[MyFirstInterface logMessage:]):
3721 (GlobalImp::className):
3722 (readJavaScriptFromFile):
3727 2004-02-08 Darin Adler <darin@apple.com>
3731 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3733 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3734 macros from working right in C++ code that uses the <cctype> header.
3737 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3738 (KJS::UTF8SequenceLengthNonASCII): Added.
3739 (KJS::inlineUTF8SequenceLength): Added.
3740 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3741 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3742 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3743 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3744 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3746 - fixed the test program so it won't hit the interpreter lock assertion
3748 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3752 2004-02-06 Richard Williamson <rjw@apple.com>
3754 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.
3758 * bindings/jni/jni_jsobject.cpp:
3759 (JSObject::toString):
3760 * bindings/jni/jni_utility.cpp:
3761 (KJS::Bindings::convertValueToJValue):
3763 2004-02-02 Darin Adler <darin@apple.com>
3767 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3769 * kjs/array_object.cpp:
3770 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3771 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3772 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3773 number is out of range. This prevents new Array(-1) from causing trouble.
3775 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3777 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3778 casting to int. Results now match those in other browsers.
3780 2004-02-02 Darin Adler <darin@apple.com>
3784 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3785 - fixed other related overflow issues
3787 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3789 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3790 must not restrict values to the range of a particular integer type.
3791 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3792 proper handling for negative results from fmod.
3793 (ValueImp::toUInt32): Ditto.
3794 (ValueImp::toUInt16): Ditto.
3795 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3797 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3798 out-of-integer-range values better in the slice function.
3799 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3800 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3801 out-of-integer-range values better in the toString function.
3802 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3803 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3804 and substr functions.
3808 2004-01-30 Richard Williamson <rjw@apple.com>
3810 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3814 * bindings/jni/jni_instance.cpp:
3815 (JavaInstance::stringValue):
3817 2004-01-26 Darin Adler <darin@apple.com>
3819 * Makefile.am: Switch from pbxbuild to xcodebuild.
3821 2004-01-22 Richard Williamson <rjw@apple.com>
3823 Added stubs for ObjC language binding to JavaScript.
3825 * JavaScriptCore.pbproj/project.pbxproj:
3826 * bindings/jni/jni_runtime.h:
3827 * bindings/objc/objc_runtime.h: Added.
3828 (KJS::Bindings::ObjcParameter::ObjcParameter):
3829 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3830 (KJS::Bindings::ObjcParameter::operator=):
3831 (KJS::Bindings::ObjcParameter::type):
3832 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3833 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3834 (KJS::Bindings::ObjcConstructor::_commonCopy):
3835 (KJS::Bindings::ObjcConstructor::operator=):
3836 (KJS::Bindings::ObjcConstructor::value):
3837 (KJS::Bindings::ObjcConstructor::parameterAt):
3838 (KJS::Bindings::ObjcConstructor::numParameters):
3839 (KJS::Bindings::ObjcField::ObjcField):
3840 (KJS::Bindings::ObjcField::~ObjcField):
3841 * bindings/runtime.h:
3843 2004-01-22 Richard Williamson <rjw@apple.com>
3845 Simplified JavaString by using UString as backing store. This
3846 revealed a bug in CString's assignment operator which I fixed.
3848 Removed some dead code.
3852 * bindings/jni/jni_runtime.h:
3853 (KJS::Bindings::JavaString::JavaString):
3854 (KJS::Bindings::JavaString::_commonInit):
3855 (KJS::Bindings::JavaString::UTF8String):
3856 (KJS::Bindings::JavaString::uchars):
3857 (KJS::Bindings::JavaString::length):
3858 (KJS::Bindings::JavaString::ustring):
3859 * bindings/runtime_object.cpp:
3860 (RuntimeObjectImp::RuntimeObjectImp):
3861 * bindings/runtime_object.h:
3863 (KJS::CString::CString):
3864 (KJS::CString::operator=):
3870 2004-01-16 Richard Williamson <rjw@apple.com>
3872 Fixed 3525853. We weren't handling mapping to overloaded Java
3873 methods very well. Even though this is undefined the other
3874 browsers support it. Also fixed a bug with returning arrays
3875 from Java functions.
3879 * bindings/jni/jni_class.cpp:
3880 (JavaClass::_commonInit):
3881 (JavaClass::methodsNamed):
3882 * bindings/jni/jni_class.h:
3883 * bindings/jni/jni_instance.cpp:
3884 (JavaInstance::invokeMethod):
3885 * bindings/jni/jni_instance.h:
3886 * bindings/jni/jni_runtime.cpp:
3887 (JavaArray::convertJObjectToArray):
3888 (JavaField::valueFromInstance):
3889 (JavaMethod::signature):
3890 (JavaArray::valueAt):
3891 * bindings/jni/jni_runtime.h:
3892 * bindings/jni_jsobject.cpp:
3894 (JSObject::convertJObjectToValue):
3895 * bindings/runtime.cpp:
3896 (MethodList::addMethod):
3897 (MethodList::length):
3898 (MethodList::methodAt):
3899 (MethodList::~MethodList):
3900 * bindings/runtime.h:
3901 (KJS::Bindings::MethodList::MethodList):
3902 * bindings/runtime_method.cpp:
3903 (RuntimeMethodImp::RuntimeMethodImp):
3904 (RuntimeMethodImp::get):
3905 (RuntimeMethodImp::call):
3906 * bindings/runtime_method.h:
3907 * bindings/runtime_object.cpp:
3908 (RuntimeObjectImp::get):
3909 (RuntimeObjectImp::hasProperty):
3911 2004-01-16 Richard Williamson <rjw@apple.com>
3913 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3914 protection implemented for 3530401.
3918 * bindings/runtime_method.cpp:
3919 (RuntimeMethodImp::call):
3921 2004-01-15 Richard Williamson <rjw@apple.com>
3923 Fixed 3530401. JNI doesn't cleanup local refs created on the
3924 main thread. IMO this is a bad bug in our JMI implementation.
3926 To work-around the problem I explicitly delete all local refs.
3927 Further, I've added Push/PopLocalFrame calls to catch any refs
3928 that I may have missed. This will guarantee that we don't leak
3929 any Java references.
3933 * bindings/jni/jni_class.cpp:
3934 (JavaClass::_commonInit):
3935 (JavaClass::JavaClass):
3936 * bindings/jni/jni_instance.cpp:
3937 (JavaInstance::begin):
3938 (JavaInstance::end):
3939 * bindings/jni/jni_instance.h:
3940 * bindings/jni/jni_runtime.cpp:
3941 (JavaConstructor::JavaConstructor):
3942 (JavaMethod::JavaMethod):
3943 * bindings/jni_jsobject.cpp:
3944 (JSObject::listFromJArray):
3945 * bindings/runtime.h:
3946 (KJS::Bindings::Instance::begin):
3947 (KJS::Bindings::Instance::end):
3948 * bindings/runtime_object.cpp:
3949 (RuntimeObjectImp::get):
3950 (RuntimeObjectImp::put):
3951 (RuntimeObjectImp::canPut):
3952 (RuntimeObjectImp::hasProperty):
3953 (RuntimeObjectImp::defaultValue):
3955 2004-01-15 Vicki Murley <vicki@apple.com>
3959 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3961 2004-01-14 Richard Williamson <rjw@apple.com>
3963 Fixed 3529466. With recent changes to Java plugin we must no
3964 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3968 * bindings/jni/jni_instance.cpp:
3969 (JObjectWrapper::JObjectWrapper):
3973 2004-01-14 Richard Williamson <rjw@apple.com>
3977 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.
3981 * bindings/jni_jsobject.cpp:
3983 (removeJavaReference):
3984 (RootObject::removeAllJavaReferencesForRoot):
3987 2004-01-13 Richard Williamson <rjw@apple.com>
3991 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.
3995 * bindings/jni_jsobject.h:
3996 (KJS::Bindings::RootObject::~RootObject):
4002 2004-01-06 Richard Williamson <rjw@apple.com>
4004 Fixed 3521814. Finalize messages weren't being dispatched!
4008 * bindings/jni_jsobject.cpp:
4011 2004-01-05 Richard Williamson <rjw@apple.com>
4013 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
4014 described by 3515579.
4016 Also cleanup up logging of Java exceptions.
4020 * bindings/jni/jni_class.cpp:
4021 (JavaClass::classForInstance):
4022 * bindings/jni/jni_instance.cpp:
4023 (JavaInstance::JavaInstance):
4024 (JavaInstance::getClass):
4025 (JavaInstance::invokeMethod):
4026 (JObjectWrapper::JObjectWrapper):
4027 (JObjectWrapper::~JObjectWrapper):
4028 * bindings/jni/jni_instance.h:
4029 (KJS::Bindings::JavaInstance::operator=):
4030 * bindings/jni/jni_runtime.cpp:
4031 (JavaMethod::JavaMethod):
4032 (JavaMethod::methodID):
4033 * bindings/jni/jni_runtime.h:
4034 (KJS::Bindings::JavaMethod::JavaMethod):
4035 * bindings/jni/jni_utility.cpp:
4039 (KJS::Bindings::getMethodID):
4040 (KJS::Bindings::callJNIVoidMethodIDA):
4041 (KJS::Bindings::callJNIObjectMethodIDA):
4042 (KJS::Bindings::callJNIByteMethodIDA):
4043 (KJS::Bindings::callJNICharMethodIDA):
4044 (KJS::Bindings::callJNIShortMethodIDA):
4045 (KJS::Bindings::callJNIIntMethodIDA):
4046 (KJS::Bindings::callJNILongMethodIDA):
4047 (KJS::Bindings::callJNIFloatMethodIDA):
4048 (KJS::Bindings::callJNIDoubleMethodIDA):
4049 (KJS::Bindings::callJNIBooleanMethodIDA):
4050 (KJS::Bindings::getCharactersFromJStringInEnv):
4051 (KJS::Bindings::getUCharactersFromJStringInEnv):
4052 (KJS::Bindings::getJNIField):
4053 * bindings/jni/jni_utility.h:
4055 l2003-12-23 John Sullivan <sullivan@apple.com>
4057 * JavaScriptCore.pbproj/project.pbxproj:
4058 Xcode version wars, harmless
4060 2003-12-23 Darin Adler <darin@apple.com>
4062 Reviewed by John (concept, not code, which is just the old code coming back).
4064 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
4066 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
4067 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
4069 2003-12-19 Richard Williamson <rjw@apple.com>
4071 Fixed 3515597. When an error occurs we need
4072 to make sure result values are zeroed.
4074 Cleaned up logs by adding a newline.
4078 * bindings/jni/jni_utility.cpp:
4079 (KJS::Bindings::getJavaVM):
4080 (KJS::Bindings::getJNIEnv):
4083 (KJS::Bindings::getJNIField):
4084 * bindings/jni_jsobject.cpp:
4085 (JSObject::convertValueToJObject):
4089 2003-12-17 Richard Williamson <rjw@apple.com>
4091 Ensure that all the symbols we export are in the KJS
4092 namespace (3512245).
4094 Also renamed JavaString.characters() to JavaString.UTF8String()
4095 for enhanced clarity.
4097 Added some sanity checking to constructor of JObjectWrapper.
4102 * bindings/jni/jni_class.cpp:
4103 * bindings/jni/jni_class.h:
4104 * bindings/jni/jni_instance.cpp:
4105 (JavaInstance::invokeMethod):
4106 (JObjectWrapper::JObjectWrapper):
4107 * bindings/jni/jni_instance.h:
4108 * bindings/jni/jni_runtime.cpp:
4109 (JavaParameter::JavaParameter):
4110 (JavaField::JavaField):
4111 (JavaMethod::JavaMethod):
4112 (JavaMethod::signature):
4113 * bindings/jni/jni_runtime.h:
4114 (KJS::Bindings::JavaString::ascii):
4115 (KJS::Bindings::JavaString::UTF8String):
4116 (KJS::Bindings::JavaString::JavaString):
4117 (KJS::Bindings::JavaString::_commonInit):
4118 (KJS::Bindings::JavaString::uchars):
4119 (KJS::Bindings::JavaString::length):
4120 (KJS::Bindings::JavaString::ustring):
4121 (KJS::Bindings::JavaParameter::type):
4122 (KJS::Bindings::JavaField::name):
4123 (KJS::Bindings::JavaField::type):
4124 (KJS::Bindings::JavaMethod::name):
4125 (KJS::Bindings::JavaMethod::returnType):
4126 * bindings/jni/jni_utility.cpp:
4127 (KJS::Bindings::getJavaVM):
4128 (KJS::Bindings::getJNIEnv):
4129 (KJS::Bindings::callJNIVoidMethod):
4130 (KJS::Bindings::callJNIObjectMethod):
4131 (KJS::Bindings::callJNIBooleanMethod):
4132 (KJS::Bindings::callJNIByteMethod):
4133 (KJS::Bindings::callJNICharMethod):
4134 (KJS::Bindings::callJNIShortMethod):
4135 (KJS::Bindings::callJNIIntMethod):
4136 (KJS::Bindings::callJNILongMethod):
4137 (KJS::Bindings::callJNIFloatMethod):
4138 (KJS::Bindings::callJNIDoubleMethod):
4139 (KJS::Bindings::callJNIVoidMethodA):
4140 (KJS::Bindings::callJNIObjectMethodA):
4141 (KJS::Bindings::callJNIByteMethodA):
4142 (KJS::Bindings::callJNICharMethodA):
4143 (KJS::Bindings::callJNIShortMethodA):
4144 (KJS::Bindings::callJNIIntMethodA):
4145 (KJS::Bindings::callJNILongMethodA):
4146 (KJS::Bindings::callJNIFloatMethodA):
4147 (KJS::Bindings::callJNIDoubleMethodA):
4148 (KJS::Bindings::callJNIBooleanMethodA):
4149 (KJS::Bindings::getCharactersFromJString):
4150 (KJS::Bindings::releaseCharactersForJString):
4151 (KJS::Bindings::getCharactersFromJStringInEnv):
4152 (KJS::Bindings::releaseCharactersForJStringInEnv):
4153 (KJS::Bindings::getUCharactersFromJStringInEnv):
4154 (KJS::Bindings::releaseUCharactersForJStringInEnv):
4155 (KJS::Bindings::JNITypeFromClassName):
4156 (KJS::Bindings::signatureFromPrimitiveType):
4157 (KJS::Bindings::JNITypeFromPrimitiveType):
4158 (KJS::Bindings::getJNIField):
4159 (KJS::Bindings::convertValueToJValue):
4160 * bindings/jni/jni_utility.h:
4161 * bindings/jni_jsobject.cpp:
4162 (KJS::Bindings::JSObject::invoke):
4163 (KJS::Bindings::JSObject::JSObject):
4164 (KJS::Bindings::JSObject::call):
4165 (KJS::Bindings::JSObject::eval):
4166 (KJS::Bindings::JSObject::getMember):
4167 (KJS::Bindings::JSObject::setMember):
4168 (KJS::Bindings::JSObject::removeMember):
4169 (KJS::Bindings::JSObject::getSlot):
4170 (KJS::Bindings::JSObject::setSlot):
4171 (KJS::Bindings::JSObject::toString):
4172 (KJS::Bindings::JSObject::finalize):
4173 (KJS::Bindings::JSObject::createNative):
4174 (KJS::Bindings::JSObject::convertValueToJObject):
4175 (KJS::Bindings::JSObject::convertJObjectToValue):
4176 (KJS::Bindings::JSObject::listFromJArray):
4177 * bindings/jni_jsobject.h:
4178 * bindings/runtime.cpp:
4179 * bindings/runtime.h:
4180 * bindings/runtime_method.cpp:
4181 * bindings/runtime_method.h:
4185 2003-12-16 Richard Williamson <rjw@apple.com>