1 2007-06-13 Simon Hausmann <hausmann@kde.org>
5 * kjs/testkjs.pro: WebKitQt is now called QtWebKit.
7 2007-06-12 Anders Carlsson <andersca@apple.com>
11 * bindings/qt/qt_instance.cpp:
12 (KJS::Bindings::QtInstance::invokeMethod):
14 2007-06-12 Anders Carlsson <andersca@apple.com>
18 Move the notion of field type to the JNI runtime since that's the only
19 one that was actually using it.
21 * bindings/c/c_runtime.h:
22 (KJS::Bindings::CField::CField):
23 * bindings/jni/jni_runtime.h:
24 * bindings/objc/objc_runtime.h:
25 * bindings/objc/objc_runtime.mm:
26 * bindings/qt/qt_runtime.h:
28 * bindings/runtime_method.cpp:
30 2007-06-12 Anders Carlsson <andersca@apple.com>
34 * bindings/qt/qt_class.cpp:
35 (KJS::Bindings::QtClass::methodsNamed):
36 * bindings/qt/qt_instance.cpp:
37 (KJS::Bindings::QtInstance::invokeMethod):
39 2007-06-12 Anders Carlsson <andersca@apple.com>
43 Get rid of the MethodList class and use a good ol' Vector instead.
45 * bindings/c/c_class.cpp:
46 (KJS::Bindings::CClass::methodsNamed):
47 * bindings/c/c_instance.cpp:
48 (KJS::Bindings::CInstance::invokeMethod):
49 * bindings/jni/jni_class.cpp:
50 (JavaClass::JavaClass):
51 (JavaClass::~JavaClass):
52 * bindings/jni/jni_instance.cpp:
53 (JavaInstance::invokeMethod):
54 * bindings/objc/objc_class.mm:
55 (KJS::Bindings::ObjcClass::methodsNamed):
56 * bindings/objc/objc_instance.mm:
57 (ObjcInstance::invokeMethod):
58 * bindings/objc/objc_runtime.mm:
59 (ObjcFallbackObjectImp::callAsFunction):
60 * bindings/runtime.cpp:
62 * bindings/runtime_method.cpp:
63 (RuntimeMethod::lengthGetter):
64 (RuntimeMethod::callAsFunction):
65 * bindings/runtime_object.cpp:
66 (RuntimeObjectImp::getOwnPropertySlot):
68 2007-06-12 Anders Carlsson <andersca@apple.com>
72 Make RuntimeMethod's method list a pointer so that the object size doesn't
73 grow beyond 32 bytes when we later will replace MethodList with a Vector.
75 * bindings/runtime_method.cpp:
76 (RuntimeMethod::RuntimeMethod):
77 (RuntimeMethod::lengthGetter):
78 (RuntimeMethod::callAsFunction):
79 * bindings/runtime_method.h:
81 2007-06-12 Anders Carlsson <andersca@apple.com>
85 Get rid of the Parameter class.
87 * bindings/jni/jni_instance.cpp:
88 (JavaInstance::invokeMethod):
89 * bindings/jni/jni_runtime.cpp:
90 (JavaMethod::signature):
91 * bindings/jni/jni_runtime.h:
92 (KJS::Bindings::JavaParameter::JavaParameter):
93 (KJS::Bindings::JavaParameter::~JavaParameter):
94 (KJS::Bindings::JavaParameter::type):
95 (KJS::Bindings::JavaMethod::parameterAt):
96 (KJS::Bindings::JavaMethod::numParameters):
99 2007-06-12 Anders Carlsson <andersca@apple.com>
103 * bindings/qt/qt_class.h:
105 2007-06-12 Mark Rowe <mrowe@apple.com>
109 * bindings/objc/objc_runtime.h:
111 2007-06-12 Anders Carlsson <andersca@apple.com>
115 Get rid of Constructor and its only subclass JavaConstructor.
117 * bindings/c/c_class.h:
118 * bindings/jni/jni_class.cpp:
119 (JavaClass::JavaClass):
120 (JavaClass::~JavaClass):
121 * bindings/jni/jni_class.h:
122 * bindings/jni/jni_runtime.cpp:
123 * bindings/jni/jni_runtime.h:
124 * bindings/objc/objc_class.h:
125 * bindings/runtime.h:
127 2007-06-12 Anders Carlsson <andersca@apple.com>
131 Use RetainPtr throughout the bindings code.
133 * bindings/objc/objc_class.h:
134 * bindings/objc/objc_class.mm:
135 (KJS::Bindings::ObjcClass::ObjcClass):
136 (KJS::Bindings::ObjcClass::methodsNamed):
137 (KJS::Bindings::ObjcClass::fieldNamed):
138 * bindings/objc/objc_instance.h:
139 (KJS::Bindings::ObjcInstance::getObject):
140 * bindings/objc/objc_instance.mm:
141 (ObjcInstance::ObjcInstance):
142 (ObjcInstance::~ObjcInstance):
143 (ObjcInstance::implementsCall):
144 (ObjcInstance::invokeMethod):
145 (ObjcInstance::invokeDefaultMethod):
146 (ObjcInstance::defaultValue):
147 * bindings/objc/objc_runtime.h:
148 (KJS::Bindings::ObjcMethod::setJavaScriptName):
149 (KJS::Bindings::ObjcMethod::javaScriptName):
150 (KJS::Bindings::ObjcArray::getObjcArray):
151 * bindings/objc/objc_runtime.mm:
153 (ObjcArray::ObjcArray):
154 (ObjcArray::setValueAt):
155 (ObjcArray::valueAt):
156 (ObjcArray::getLength):
159 2007-06-12 Anders Carlsson <andersca@apple.com>
163 Have JSCell inherit from Noncopyable.
165 * bindings/objc/objc_runtime.h:
166 * bindings/runtime_object.h:
169 2007-06-12 Anders Carlsson <andersca@apple.com>
171 Reviewed by Darin and Maciej.
173 More cleanup. Use our Noncopyable WTF class, add a root object member
176 * bindings/c/c_class.h:
177 * bindings/jni/jni_class.h:
178 * bindings/jni/jni_instance.h:
179 * bindings/jni/jni_runtime.cpp:
180 (JavaArray::JavaArray):
181 * bindings/jni/jni_runtime.h:
182 * bindings/objc/objc_class.h:
183 * bindings/objc/objc_runtime.h:
184 * bindings/objc/objc_runtime.mm:
185 (ObjcArray::ObjcArray):
186 * bindings/objc/objc_utility.mm:
187 (KJS::Bindings::convertObjcValueToValue):
188 * bindings/runtime.cpp:
189 (KJS::Bindings::Array::Array):
190 (KJS::Bindings::Array::~Array):
191 * bindings/runtime.h:
192 * bindings/runtime_object.h:
193 * bindings/runtime_root.h:
195 2007-06-08 Zack Rusin <zrusin@trolltech.com>
199 * bindings/qt/qt_instance.cpp:
200 (KJS::Bindings::QtInstance::QtInstance):
201 * bindings/qt/qt_instance.h:
203 2007-06-07 Anders Carlsson <andersca@apple.com>
207 Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
209 * bindings/c/c_instance.cpp:
210 (KJS::Bindings::CInstance::CInstance):
211 * bindings/c/c_instance.h:
212 * bindings/jni/jni_instance.cpp:
213 (JavaInstance::JavaInstance):
214 * bindings/jni/jni_instance.h:
215 * bindings/jni/jni_jsobject.cpp:
216 (JavaJSObject::convertJObjectToValue):
217 * bindings/objc/objc_instance.h:
218 * bindings/objc/objc_instance.mm:
219 (ObjcInstance::ObjcInstance):
220 * bindings/runtime.cpp:
221 (KJS::Bindings::Instance::Instance):
222 (KJS::Bindings::Instance::createBindingForLanguageInstance):
223 * bindings/runtime.h:
225 2007-06-07 Anders Carlsson <andersca@apple.com>
229 Don't use a JavaInstance to store the field when all we want to do is to keep the field
230 from being garbage collected. Instead, use a JObjectWrapper.
232 * bindings/jni/jni_instance.h:
233 * bindings/jni/jni_runtime.cpp:
234 (JavaField::JavaField):
235 (JavaField::dispatchValueFromInstance):
236 (JavaField::dispatchSetValueToInstance):
237 * bindings/jni/jni_runtime.h:
238 (KJS::Bindings::JavaField::JavaField):
239 (KJS::Bindings::JavaField::operator=):
241 2007-05-30 Alp Toker <alp.toker@collabora.co.uk>
245 Enable logging in the Gdk port.
246 http://bugs.webkit.org/show_bug.cgi?id=13936
248 * wtf/Assertions.cpp:
249 * wtf/Assertions.h: Add WTFLogVerbose which also logs
250 the file, line number and function.
252 2007-05-30 Mark Rowe <mrowe@apple.com>
254 Mac build fix. Update #include.
256 * API/JSCallbackFunction.h:
258 2007-05-30 Luciano Montanaro <mikelima@cirulla.net>
262 - cross-port Harri Porten's commits 636099 and 636108 from KJS:
263 "publish a class anyway public already" and "class is being used from
264 outside for quite some time" in preparation for further syncronizations
267 * kjs/date_object.cpp:
271 (KJS::InternalFunctionImp::classInfo):
272 (KJS::InternalFunctionImp::functionName):
273 * kjs/function_object.h:
276 (KJS::getStaticPropertySlot):
277 (KJS::getStaticFunctionSlot):
278 (KJS::getStaticValueSlot):
279 * kjs/object_object.h:
281 2007-05-29 Sam Weinig <sam@webkit.org>
283 Reviewed by Adam Roben.
285 Cleanup function and fix to match comparison API.
287 * kjs/string_object.cpp:
288 (KJS::substituteBackreferences):
289 (KJS::localeCompare):
291 2007-05-28 Geoffrey Garen <ggaren@apple.com>
293 Slight clarification to an exception message.
295 * API/JSCallbackObject.cpp:
296 (KJS::JSCallbackObject::put):
298 2007-05-27 Holger Freyther <zecke@selfish.org>
300 Reviewed by Mark Rowe.
302 * wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin
304 2007-05-27 Darin Adler <darin@apple.com>
306 - fix a couple ifdefs that said WIN instead of WIN_OS
309 (KJS::allocateBlock): WIN -> WIN_OS
310 (KJS::freeBlock): Ditto.
312 2007-05-26 Sam Weinig <sam@webkit.org>
316 Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
317 Port of commit 667785 from kjs
319 - special case calling String.localeCompare() with no parameters to return 0.
321 * kjs/string_object.cpp:
322 (KJS::StringProtoFunc::callAsFunction):
324 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
328 - Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
329 REGRESSION: setTimeout "arguments" object gets shadowed by a local variable
331 - Add a explicit check for arguments. Previously check was done with getDirect,
332 but since the arguments is created on-demand in ActivationImp, it doesn't
333 show up in the test. 'arguments' should always be in the VarDeclNode's
337 (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'
339 2007-05-25 George Staikos <staikos@kde.org>
343 - Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines
347 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
351 - http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
352 doesn't compile with "++(x,y)")
353 - Create the error node based on the actual node, not the node inside
355 - Fix applies to postfix, prefix and typeof operators
356 - Produces run-time ReferenceError like other non-lvalue assignments etc.
358 * kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
359 not the based on the node returned by "nodeInsideAllParens()". Same for
362 2007-05-25 Simon Hausmann <hausmann@kde.org>
366 Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
367 registered with QMetaType.
369 * bindings/qt/qt_instance.cpp:
370 (KJS::Bindings::QtInstance::invokeMethod):
371 * bindings/qt/qt_runtime.cpp:
373 2007-05-24 Luciano Montanaro <mikelima@cirulla.net>
377 Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
378 Port patch 666176 to JavaScriptCore
380 - Renamed JSValue::downcast() to JSValue::asCell() which makes the
381 function meaning cleaner. It's modeled after Harri Porten change in
385 (KJS::Collector::protect):
386 (KJS::Collector::unprotect):
387 (KJS::Collector::collectOnMainThreadOnly):
389 (KJS::JSValue::isObject):
390 * kjs/string_object.cpp:
391 (KJS::StringProtoFunc::callAsFunction):
393 (KJS::JSValue::asCell):
394 (KJS::JSValue::isNumber):
395 (KJS::JSValue::isString):
396 (KJS::JSValue::isObject):
397 (KJS::JSValue::getNumber):
398 (KJS::JSValue::getString):
399 (KJS::JSValue::getObject):
400 (KJS::JSValue::getUInt32):
401 (KJS::JSValue::mark):
402 (KJS::JSValue::marked):
403 (KJS::JSValue::type):
404 (KJS::JSValue::toPrimitive):
405 (KJS::JSValue::toBoolean):
406 (KJS::JSValue::toNumber):
407 (KJS::JSValue::toString):
408 (KJS::JSValue::toObject):
410 2007-05-18 Holger Hans Peter Freyther <zecke@selfish.org>
412 Reviewed by Mark Rowe.
414 * kjs/testkjs.pro: Make the Gdk port link to icu
416 2007-05-15 Geoffrey Garen <ggaren@apple.com>
418 Reviewed by Adele Peterson.
420 It helps if you swap the right variable.
425 2007-05-15 Lars Knoll <lars@trolltech.com>
429 Extend the QObject JavaScript bindings to work for slots with
432 * bindings/qt/qt_instance.cpp:
433 (KJS::Bindings::QtInstance::invokeMethod):
435 2007-05-14 Kimmo Kinnunen <kimmok@iki.fi>
439 - Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
440 omits trailing comma in array literal)
442 * kjs/nodes2string.cpp:
443 (ArrayNode::streamTo): print extra ',' in case there was elision
444 commas (check opt member var) and array elements present
445 in the array expression
447 2007-05-14 Geoffrey Garen <ggaren@apple.com>
449 Reviewed by Oliver Hunt.
451 Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
452 I figured while I was in the neighborhood I might as well add HashMap::swap,
462 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
466 - Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
467 Bogus decompilation of "for (var j = 1 in [])"
468 - ForInNode toString()'ed to syntax error if there was var decl
470 - ForNode toStringed()'ed lost 'var ' if it was present
472 * kjs/nodes2string.cpp:
473 (VarDeclListNode::streamTo): Print "var " here
474 (VarStatementNode::streamTo): Don't print "var " here
475 (ForNode::streamTo): Remove TODO comment, VarDeclListNode will
477 (ForInNode::streamTo): ForIn initializer is printed by VarDeclNode
479 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
483 - Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
484 (Incorrect decompilation for "4..x")
485 - Group numbers in dotted expressions in toString() output, so we
486 avoid the 4.x constructs when the original input is 4..x.
487 4..x means the same as 4. .x or (4).x or Number(4).x
489 * kjs/nodes2string.cpp:
490 (KJS::SourceStream::):
491 Add boolean flag to indicate that if next item is a number, it should be grouped.
492 Add new formatting enum which turns on the boolean flag.
493 (KJS::SourceStream::SourceStream): Added. Initialize the flag.
494 (SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
495 (NumberNode::streamTo): Use the double operator
496 (ArrayNode::streamTo):
497 (DotAccessorNode::streamTo):
498 (FunctionCallDotNode::streamTo):
499 (FunctionCallParenDotNode::streamTo):
500 (PostfixDotNode::streamTo):
501 (DeleteDotNode::streamTo):
502 (PrefixDotNode::streamTo):
503 (AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.
505 2007-05-10 Lars Knoll <lars@trolltech.com>
509 Fix our last three test failures in the JavaScript
512 * wtf/unicode/qt4/UnicodeQt4.h:
513 (WTF::Unicode::toLower):
514 (WTF::Unicode::toUpper):
516 2007-05-08 Geoffrey Garen <ggaren@apple.com>
518 Reviewed by Darin Adler.
520 Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I
521 misunderstood this issue before.
523 * API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
524 want this behavior can just #include individual headers, instead of the
525 umbrella framework header. But we definitely want Mac OS X clients to
526 get the #include of JSStringRefCF.h "for free."
527 * API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
528 JavaScriptCore.h, either.)
529 * API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
530 regardless of whether __APPLE__ is defined. Platforms that don't support
531 CF just shouldn't compile this file.
534 2007-05-09 Eric Seidel <eric@webkit.org>
538 http://bugs.webkit.org/show_bug.cgi?id=6985
539 Cyclic __proto__ values cause WebKit to hang
542 (KJS::JSObject::put): do a cycle check before setting __proto__
544 2007-05-08 Kimmo Kinnunen <kimmok@iki.fi>
546 Reviewed by darin. Landed by eseidel.
548 - http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains
549 a semicolon each time it is toStringed)
550 Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
551 EmptyStatement was created after every do..while(expr) which
552 had semicolon at the end.
554 * kjs/grammar.y: Require semicolon at the end of do..while
556 2007-05-08 Geoffrey Garen <ggaren@apple.com>
558 Build fix -- this time for sure.
560 APICast.h, being private, ends up in a different folder than JSValueRef.h,
561 so we can't include one from the other using "". Instead, just forward
562 declare the relevant data types.
566 2007-05-08 Geoffrey Garen <ggaren@apple.com>
568 Build fix: export APICast.h for WebCore and WebKit.
570 * JavaScriptCore.xcodeproj/project.pbxproj:
572 2007-05-04 Darin Adler <darin@apple.com>
576 - fix http://bugs.webkit.org/show_bug.cgi?id=12821
577 <rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
579 * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
580 Added a call to fabs before calling log10.
582 2007-05-03 Holger Freyther <freyther@kde.org>
584 Reviewed by Zack, landed by Simon.
585 This is bugzilla bug 13499.
587 * JavaScriptCore.pri: Place Qt into the qt-port scope
588 * bindings/testbindings.pro: Place Qt into the qt-port scope
589 * kjs/testkjs.pro: Place Qt into the qt-port scope
590 * pcre/pcre.pri: Place Qt into the qt-port scope
592 2007-05-02 David Harrison <harrison@apple.com>
596 <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
598 Added insertion support for more than one value.
602 Added support for inserting multiple values.
605 New. Insert at the start of vectors. Convenient for vectors used as strings.
607 2007-05-01 Jungshik Shin <jungshik.shin@gmail.com>
611 - get rid of non-ASCII lteral characters : suppress compiler warnings
612 http://bugs.webkit.org/show_bug.cgi?id=13551
615 * pcre/pcre_compile.c:
617 2007-04-28 Jungshik Shin <jungshik.shin@gmail.com>
619 Reviewed by Sam Weinig.
621 - Replace copyright sign in Latin-1 (0xA9) with '(C)'
622 http://bugs.webkit.org/show_bug.cgi?id=13531
624 * bindings/npruntime.h:
626 2007-04-28 Darin Adler <darin@apple.com>
630 - fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet
632 Test: fast/forms/add-remove-form-elements-stress-test.html
635 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
636 m_isDoneWithInitialFreeList to false.
637 (WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
638 m_isAllocated flag that make sure we don't allocate a block that's already allocated.
639 These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
640 allocate the last block of the initial free list. Once we're done with the initial
641 free list, turn off the rule that says that the next node in the pool after the last
642 node in the free list is also free. This rule works because any free nodes are added
643 to the head of the free list, so a node that hasn't been allocated even once is always
644 at the tail of the free list and all the nodes after it also haven't been allocated
645 even once. But it doesn't work any longer once the entire pool has been used at least
646 once, because there's nothing special about the last node on the free list any more.
647 (WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
648 (WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
649 (WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
650 (WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
651 (WTF::ListHashSetNode::operator new): Removed variable name for unused size
653 (WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
654 delete -- this gets rid of the need to define an operator delete.
656 2007-04-27 Christopher Brichford <chrisb@adobe.com>
658 Reviewed by Timothy Hatcher.
660 Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
661 http://bugs.webkit.org/show_bug.cgi?id=13211
663 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
664 * JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
665 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
666 * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
667 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
668 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
669 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
670 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.
672 2007-04-27 Holger Freyther <freyther@kde.org>
676 Remove unmaintained CMake build system.
678 * CMakeLists.txt: Removed.
679 * pcre/CMakeLists.txt: Removed.
681 2007-04-27 Mark Rowe <mrowe@apple.com>
685 * JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
686 by marking dftables as a dependency of Generate Derived Sources rather than of
687 JavaScriptCore itself.
689 2007-04-26 Geoffrey Garen <ggaren@apple.com>
691 Build fix -- added #includes that we used to get implicitly through
699 2007-04-26 Geoffrey Garen <ggaren@apple.com>
701 Reviewed by Maciej Stachowiak, Adam Roben.
704 <rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
705 <rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes
707 * API/JSStringRef.h: Removed #include -- no clients need it anymore.
709 2007-04-25 David Kilzer <ddkilzer@apple.com>
713 Add assertions for debug builds.
716 (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
717 (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
719 2007-04-25 Maciej Stachowiak <mjs@apple.com>
725 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
726 gives often downright incorrect results based on guessing what will happen in 64-bit.
728 2007-04-25 Darin Adler <darin@apple.com>
732 - tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
733 measure an improvement right now, but it's also clear these changes do no harm
735 * wtf/FastMalloc.cpp:
736 (WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
737 to get this single-instruction function to be inlined.
738 (WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
739 case for a size of 0 to work without a branch for a bit of extra speed.
740 (WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.
742 2007-04-24 Maciej Stachowiak <mjs@apple.com>
746 - use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost
748 Nearly all functions in nodes.cpp were marked up to use the
749 regparm(3) calling convention under GCC for x86, since this is
750 faster and they are all guaranteed to be called only internally to
753 The only exception is destructors, since delete doesn't know how to use a custom calling convention.
756 (dotExprDoesNotAllowCallsString):
759 (KJS::StatementNode::):
761 (KJS::BooleanNode::):
766 (KJS::ResolveNode::):
768 (KJS::ElementNode::):
770 (KJS::PropertyNameNode::):
771 (KJS::PropertyNode::):
772 (KJS::PropertyListNode::):
773 (KJS::ObjectLiteralNode::):
774 (KJS::BracketAccessorNode::):
775 (KJS::DotAccessorNode::):
776 (KJS::ArgumentListNode::):
777 (KJS::ArgumentsNode::):
778 (KJS::NewExprNode::):
779 (KJS::FunctionCallValueNode::):
780 (KJS::FunctionCallResolveNode::):
781 (KJS::FunctionCallBracketNode::):
782 (KJS::FunctionCallParenBracketNode::):
783 (KJS::FunctionCallDotNode::):
784 (KJS::FunctionCallParenDotNode::):
785 (KJS::PostfixResolveNode::):
786 (KJS::PostfixBracketNode::):
787 (KJS::PostfixDotNode::):
788 (KJS::PostfixErrorNode::):
789 (KJS::DeleteResolveNode::):
790 (KJS::DeleteBracketNode::):
791 (KJS::DeleteDotNode::):
792 (KJS::DeleteValueNode::):
794 (KJS::TypeOfResolveNode::):
795 (KJS::TypeOfValueNode::):
796 (KJS::PrefixResolveNode::):
797 (KJS::PrefixBracketNode::):
798 (KJS::PrefixDotNode::):
799 (KJS::PrefixErrorNode::):
800 (KJS::UnaryPlusNode::):
802 (KJS::BitwiseNotNode::):
803 (KJS::LogicalNotNode::):
807 (KJS::RelationalNode::):
809 (KJS::BitOperNode::):
810 (KJS::BinaryLogicalNode::):
811 (KJS::ConditionalNode::):
812 (KJS::AssignResolveNode::):
813 (KJS::AssignBracketNode::):
814 (KJS::AssignDotNode::):
815 (KJS::AssignErrorNode::):
817 (KJS::AssignExprNode::):
818 (KJS::VarDeclListNode::):
819 (KJS::VarStatementNode::):
820 (KJS::EmptyStatementNode::):
821 (KJS::ExprStatementNode::):
823 (KJS::DoWhileNode::):
826 (KJS::ContinueNode::):
833 (KJS::ParameterNode::):
835 (KJS::FunctionBodyNode::):
836 (KJS::FuncExprNode::):
837 (KJS::FuncDeclNode::):
838 (KJS::SourceElementsNode::):
839 (KJS::CaseClauseNode::):
840 (KJS::ClauseListNode::):
843 2007-04-24 Oliver Hunt <oliver@apple.com>
845 GTK Build fix, ::findEntry->KJS::findEntry
848 (KJS::Lookup::findEntry):
851 2007-04-23 Maciej Stachowiak <mjs@apple.com>
855 - compile most of JavaScriptCore as one file for 4% JS iBench speed improvement
857 * JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
859 * kjs/AllInOneFile.cpp: Added.
860 * kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
863 * kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;"
865 2007-04-23 Maciej Stachowiak <mjs@apple.com>
867 Build fix, not reviewed.
869 * kjs/collector.h: Fix struct/class mismatch.
871 2007-04-23 Maciej Stachowiak <mjs@apple.com>
875 - raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
877 Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
878 the two spare cells the collector is willing to keep around, so collect a bit less often.
882 2007-04-23 Maciej Stachowiak <mjs@apple.com>
884 Reviewed by Darin and Geoff.
886 - move mark and collectOnMainThreadOnly bits into separate bitmaps
888 This saves 4 bytes per cell, allowing shrink of cell size to 32,
889 which leads to a .8% speed improvement on iBench.
891 This is only feasible because of all the previous changes on the branch.
894 (KJS::allocateBlock): Adjust for some renames of constants.
895 (KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64
896 bytes on 64-bit) the cell alignment check can be made much more strict, and also
897 obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
898 bits of the pointer to have a potential block pointer to look for.
899 (KJS::Collector::collectOnMainThreadOnly): Use bitmap.
900 (KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
901 (KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
903 (KJS::): Move needed constants and type declarations here.
904 (KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
905 (KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
906 (KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
907 (KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
908 (KJS::Collector::cellBlock): New operation, compute the block pointer for
909 a cell by masking off low bits.
910 (KJS::Collector::cellOffset): New operation, compute the cell offset for a
911 cell by masking off high bits and dividing (actually a shift).
912 (KJS::Collector::isCellMarked): Check mark bit in bitmap
913 (KJS::Collector::markCell): Set mark bit in bitmap.
915 (KJS::JSCell::JSCell): No more bits.
916 (KJS::JSCell::marked): Let collector handle it.
917 (KJS::JSCell::mark): Let collector handle it.
919 2007-04-23 Anders Carlsson <andersca@apple.com>
923 * kjs/regexp_object.h:
924 RegExpObjectImpPrivate is a struct, not a class.
926 2007-04-23 Maciej Stachowiak <mjs@apple.com>
930 - shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
932 I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.
935 (KJS::FunctionImp::callAsFunction):
936 (KJS::FunctionImp::passInParameters):
937 (KJS::FunctionImp::lengthGetter):
938 (KJS::FunctionImp::getParameterName):
940 * kjs/function_object.cpp:
941 (FunctionProtoFunc::callAsFunction):
942 (FunctionObjectImp::construct):
944 (FunctionBodyNode::addParam):
945 (FunctionBodyNode::paramString):
946 (FuncDeclNode::addParams):
947 (FuncDeclNode::processFuncDecl):
948 (FuncExprNode::addParams):
949 (FuncExprNode::evaluate):
951 (KJS::Parameter::Parameter):
952 (KJS::FunctionBodyNode::numParams):
953 (KJS::FunctionBodyNode::paramName):
954 (KJS::FunctionBodyNode::parameters):
955 (KJS::FuncExprNode::FuncExprNode):
956 (KJS::FuncDeclNode::FuncDeclNode):
957 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
958 they handle size_t badly.
960 2007-04-23 Maciej Stachowiak <mjs@apple.com>
964 - shrink RegexpObjectImp by 4 bytes
966 Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
968 * kjs/regexp_object.cpp:
969 (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
970 (RegExpObjectImp::RegExpObjectImp):
971 (RegExpObjectImp::performMatch):
972 (RegExpObjectImp::arrayOfMatches):
973 (RegExpObjectImp::getBackref):
974 (RegExpObjectImp::getLastMatch):
975 (RegExpObjectImp::getLastParen):
976 (RegExpObjectImp::getLeftContext):
977 (RegExpObjectImp::getRightContext):
978 (RegExpObjectImp::getValueProperty):
979 (RegExpObjectImp::putValueProperty):
980 * kjs/regexp_object.h:
982 2007-04-23 Maciej Stachowiak <mjs@apple.com>
986 - change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
988 The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).
990 * kjs/property_map.h:
992 2007-04-23 Maciej Stachowiak <mjs@apple.com>
996 - shrink ArrayInstance objects by 4 bytes
997 http://bugs.webkit.org/show_bug.cgi?id=13386
999 I did this by storing the capacity before the beginning of the storage array. It turns out
1000 it is rarely needed and is by definition 0 when the storage array is null.
1002 * kjs/array_instance.h:
1003 (KJS::ArrayInstance::capacity): Get it from the secret stash
1004 * kjs/array_object.cpp:
1005 (allocateStorage): New function to encapsulate allocating the storage with extra space ahead
1007 (reallocateStorage): ditto for realloc
1008 (ArrayInstance::ArrayInstance):
1009 (ArrayInstance::~ArrayInstance):
1010 (ArrayInstance::resizeStorage):
1012 2007-04-23 Darin Adler <darin@apple.com>
1016 - fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
1017 modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)
1019 Despite the ECMAScript specification's claim that you can treat these as syntax
1020 errors, doing so creates some website incompatibilities. So this patch turns them back
1021 into evaluation errors instead.
1023 Test: fast/js/modify-non-references.html
1025 * kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
1026 never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
1027 new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
1029 * kjs/nodes.h: Added an overload of throwError that takes a char* argument.
1030 Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
1031 which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
1033 * kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
1034 code size than the two functions that we used before.
1035 (Node::throwError): Added the overload mentioned above.
1036 (Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
1037 and debugExceptionIfNeeded.
1038 (PostfixErrorNode::evaluate): Added. Throws an exception.
1039 (PrefixErrorNode::evaluate): Ditto.
1040 (AssignErrorNode::evaluate): Ditto.
1041 (ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
1042 effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
1043 the correct file and line number for these exceptions.
1045 * kjs/nodes2string.cpp:
1046 (PostfixErrorNode::streamTo): Added.
1047 (PrefixErrorNode::streamTo): Added.
1048 (AssignErrorNode::streamTo): Added.
1050 2007-04-23 Maciej Stachowiak <mjs@apple.com>
1054 - fix test failures / crashes on PPC
1056 * kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
1057 word there otherwise :-(
1059 2007-04-23 Maciej Stachowiak <mjs@apple.com>
1063 - fix more test case failures
1065 * bindings/runtime_array.cpp:
1066 (RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
1067 out that this class only needs the prototype and classInfo from ArrayInstance, not the
1068 actual class itself, and it was too big otherwise.
1069 (RuntimeArray::getOwnPropertySlot):
1070 * bindings/runtime_array.h:
1072 2007-04-23 Maciej Stachowiak <mjs@apple.com>
1076 - fix some test failures
1078 * bindings/runtime_method.cpp:
1079 (RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
1080 otherwise this is too big
1081 (RuntimeMethod::getOwnPropertySlot):
1082 * bindings/runtime_method.h:
1084 2007-04-22 Maciej Stachowiak <mjs@apple.com>
1088 - discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
1089 http://bugs.webkit.org/show_bug.cgi?id=13385
1091 Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do
1092 this also had many other List changes and I found this much simpler subset of the changes
1093 was actually a hair faster.
1095 This optimization is valid because the arguments list is only kept around to
1096 lazily make the arguments object. If it's not made by the time the function
1097 exits, it never will be, since any function that captures the continuation will
1098 have its own local arguments variable in scope.
1100 Besides the 1.7% speed improvement, it shrinks List by 4 bytes
1101 (which in turn shrinks ActivationImp by 4 bytes).
1104 (KJS::Context::~Context): Clear the activation's arguments list.
1106 (KJS::ActivationImp::ActivationImp): Adjusted for list changes.
1107 (KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
1108 cause a ref-cycle for reasons stated above).
1109 (KJS::ActivationImp::createArgumentsObject): Clear arguments list.
1112 (KJS::List::List): No more needsMarking boolean
1113 (KJS::List::operator=): ditto
1115 (KJS::List::List): ditto
1116 (KJS::List::reset): ditto
1117 (KJS::List::deref): ditto
1119 2007-04-22 Maciej Stachowiak <mjs@apple.com>
1123 - shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit;
1124 similar shrinkage for 64-bit)
1125 http://bugs.webkit.org/show_bug.cgi?id=13384
1127 Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
1128 done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat
1129 cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86)
1132 This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
1133 to eventually reach cell size 32.
1135 * kjs/collector.cpp:
1137 * kjs/property_map.cpp:
1138 (KJS::PropertyMap::~PropertyMap):
1139 (KJS::PropertyMap::clear):
1140 (KJS::PropertyMap::get):
1141 (KJS::PropertyMap::getLocation):
1142 (KJS::PropertyMap::put):
1143 (KJS::PropertyMap::insert):
1144 (KJS::PropertyMap::expand):
1145 (KJS::PropertyMap::rehash):
1146 (KJS::PropertyMap::remove):
1147 (KJS::PropertyMap::mark):
1148 (KJS::PropertyMap::containsGettersOrSetters):
1149 (KJS::PropertyMap::getEnumerablePropertyNames):
1150 (KJS::PropertyMap::getSparseArrayPropertyNames):
1151 (KJS::PropertyMap::save):
1152 (KJS::PropertyMap::checkConsistency):
1153 * kjs/property_map.h:
1154 (KJS::PropertyMap::hasGetterSetterProperties):
1155 (KJS::PropertyMap::setHasGetterSetterProperties):
1156 (KJS::PropertyMap::):
1157 (KJS::PropertyMap::PropertyMap):
1159 2007-04-22 Maciej Stachowiak <mjs@apple.com>
1163 - change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
1164 http://bugs.webkit.org/show_bug.cgi?id=13383
1166 * kjs/collector.cpp:
1167 (KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
1168 (KJS::freeBlock): Corresponding free
1169 (KJS::Collector::allocate):
1170 (KJS::Collector::collect):
1172 2007-04-22 Maciej Stachowiak <mjs@apple.com>
1174 Reviewed by Darin and Geoff.
1176 - remove the concept of oversize objects, now that there aren't any (for now
1177 only enforced with an assert).
1178 http://bugs.webkit.org/show_bug.cgi?id=13382
1180 This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
1181 for 64-bit since it finally gives a reasonable cell size, but I did not test that.
1183 * kjs/collector.cpp:
1184 (KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
1185 oversize allocation.
1186 (KJS::Collector::allocate): Remove oversize allocator.
1187 (KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
1188 (KJS::Collector::markMainThreadOnlyObjects): Ditto.
1189 (KJS::Collector::collect): Ditto.
1191 2007-04-21 Mitz Pettel <mitz@webkit.org>
1195 - fix http://bugs.webkit.org/show_bug.cgi?id=13428
1196 REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js
1198 - fix http://bugs.webkit.org/show_bug.cgi?id=13429
1199 REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html
1201 * kjs/array_object.cpp:
1202 (ArrayInstance::sort): Free the old storage, not the new one.
1204 2007-04-20 Maciej Stachowiak <mjs@apple.com>
1206 Not reviewed, build fix.
1208 - fix build problem with last change - -O3 complains more about uninitialized variables
1210 * pcre/pcre_compile.c:
1214 2007-04-20 Maciej Stachowiak <mjs@apple.com>
1218 - <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)
1220 * kjs/array_object.cpp:
1221 (ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
1222 to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
1223 memory. Also added comments identifying possibly even better sorting algorithms
1224 for sort by string value and sort by compare function.
1227 2007-04-20 Maciej Stachowiak <mjs@apple.com>
1231 - bump optimization flags up to -O3 for 1% JS iBench speed improvement
1233 * Configurations/Base.xcconfig:
1235 2007-04-20 Mark Rowe <mrowe@apple.com>
1239 Fix bogus optimisation in the generic pthread code path.
1241 * kjs/collector.cpp:
1242 (KJS::currentThreadStackBase):
1244 2007-04-20 Mark Rowe <mrowe@apple.com>
1248 Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.
1250 * kjs/collector.cpp:
1251 (KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
1252 initialized via pthread_attr_init before being used in any context.
1254 2007-04-19 Mark Rowe <mrowe@apple.com>
1258 Fix http://bugs.webkit.org/show_bug.cgi?id=13401
1259 Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
1260 a sort comparison function
1262 * kjs/array_object.cpp:
1263 (ArrayInstance::sort): Save/restore the static variables around calls to qsort
1264 to ensure nested calls to ArrayInstance::sort behave correctly.
1266 2007-04-12 Deneb Meketa <dmeketa@adobe.com>
1268 Reviewed by Darin Adler.
1270 http://bugs.webkit.org/show_bug.cgi?id=13029
1271 rdar://problem/4994849
1272 Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
1273 This doesn't actually change JavaScriptCore, but that's where npapi.h is.
1276 Add headers member to NPStream struct. Also increase NP_VERSION_MINOR to 18.
1277 Increasing to >= 17 allows plug-ins to safely detect whether to look for
1278 NPStream::headers. Increasing from 17 to 18 reflects presence of NPObject
1279 enumeration, which was added in a prior patch, and which has been agreed to
1280 constitute version 18 by the plugin-futures list. Also add other missing
1281 bits of npapi.h to catch up from 14 to 18. This includes features that are
1282 not implemented in WebKit, but those are safely stubbed.
1284 2007-04-10 Geoffrey Garen <ggaren@apple.com>
1286 Reviewed by Mark Rowe.
1288 Fixed last check-in to print in release builds, too.
1290 * kjs/collector.cpp:
1291 (KJS::getPlatformThreadRegisters):
1293 2007-04-10 Geoffrey Garen <ggaren@apple.com>
1295 Reviewed by John Sullivan, Darin Adler.
1297 Fixed <rdar://problem/5121899> JavaScript garbage collection leads to
1298 later crash under Rosetta (should abort or leak instead?)
1300 Log an error message and crash if the kernel reports failure during GC.
1301 We decided to do this instead of just leaking because we don't want people
1302 to get the mistaken impression that running in Rosetta is a supported
1305 The CRASH macro will also hook into CrashReporter, which will tell us if
1306 many (any?) users run into this issue.
1308 * kjs/collector.cpp:
1309 (KJS::getPlatformThreadRegisters):
1311 2007-04-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1315 Coverity fix. Coverity says:
1316 "Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
1317 function that dereferences it"
1319 * kjs/string_object.cpp:
1322 2007-04-06 Geoffrey Garen <ggaren@apple.com>
1324 Rubber stamped by Adele Peterson.
1326 * kjs/ExecState.h: Removed obsolete forward/friend declaration of
1329 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1333 Coverity fix. Coverity says:
1334 "Event check_after_deref: Pointer "dateString" dereferenced before NULL check"
1336 * kjs/date_object.cpp:
1339 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1343 Coverity fix. Coverity says:
1344 "Event check_after_deref: Pointer "re" dereferenced before NULL check"
1346 * pcre/pcre_study.c:
1349 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1353 Coverity fixes. Coverity says:
1354 "Event leaked_storage: Returned without freeing storage "buffer""
1356 "Event leaked_storage: Returned without freeing storage "script""
1360 (createStringWithContentsOfFile):
1362 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1366 Coverity fix: in single-threaded case currentThreadIsMainThread is always true
1367 so the code in if (!currentThreadIsMainThread) cannot possibly be reached
1368 and Coverity complains about dead code.
1370 * kjs/collector.cpp:
1371 (KJS::Collector::collect):
1373 === Safari-5522.6 ===
1375 2007-04-03 Kevin McCullough <kmccullough@apple.com>
1379 - Testing a post-commit hook.
1381 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1383 2007-04-03 Anders Carlsson <andersca@apple.com>
1387 <rdar://problem/5107534>
1388 http://bugs.webkit.org/show_bug.cgi?id=13265
1389 REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
1391 * bindings/NP_jsobject.cpp:
1392 (_NPN_InvokeDefault):
1393 Return false if the object isn't a function. Set the return value to undefined by default
1396 2007-03-30 Anders Carlsson <andersca@apple.com>
1400 * bindings/NP_jsobject.cpp:
1403 2007-03-30 Anders Carlsson <andersca@apple.com>
1407 Implement _NPN_Enumerate support.
1409 * JavaScriptCore.exp:
1410 * bindings/NP_jsobject.cpp:
1412 * bindings/c/c_instance.cpp:
1413 (KJS::Bindings::CInstance::getPropertyNames):
1414 * bindings/c/c_instance.h:
1416 * bindings/npruntime.h:
1417 * bindings/npruntime_impl.h:
1418 * bindings/runtime.h:
1419 (KJS::Bindings::Instance::getPropertyNames):
1420 * bindings/runtime_object.cpp:
1421 (RuntimeObjectImp::getPropertyNames):
1422 * bindings/runtime_object.h:
1423 (KJS::RuntimeObjectImp::getInternalInstance):
1425 2007-03-28 Jeff Walden <jwalden+code@mit.edu>
1429 http://bugs.webkit.org/show_bug.cgi?id=12963
1430 Fix some inconsistencies in the Mozilla JS Array extras implementations
1431 with respect to the Mozilla implementation:
1433 - holes in arrays should be skipped, not treated as undefined,
1435 - an element with value undefined is not a hole
1436 - Array.prototype.forEach should return undefined
1438 * kjs/array_object.cpp:
1439 (ArrayInstance::getOwnPropertySlot):
1440 (ArrayProtoFunc::callAsFunction):
1442 2007-03-27 Anders Carlsson <acarlsson@apple.com>
1446 * bindings/NP_jsobject.cpp:
1447 (_NPN_InvokeDefault):
1448 Call JSObject:call for native JavaScript objects.
1450 2007-03-26 David Carson <dacarson@gmail.com>
1452 Reviewed by Darin, landed by Anders.
1454 Fix for: REGRESSION (r19559): Java applet crash
1455 http://bugs.webkit.org/show_bug.cgi?id=13142
1456 <rdar://problem/5080340>
1458 The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636
1459 introduced new JNIType to enum in jni_utility.h This is a
1460 problem on the Mac as it seems that the JNIType enum is also
1461 used in the JVM, it is used to specify the return type in
1463 Corrected the fix by moving type to the end, and changing
1464 jni_objc.mm to convert the new type to an old compatible
1467 * bindings/jni/jni_objc.mm:
1468 (KJS::Bindings::dispatchJNICall):
1469 * bindings/jni/jni_utility.h:
1471 2007-03-26 Christopher Brichford <chrisb@adobe.com>
1473 Reviewed/landed by Adam.
1475 Bug 13198: Move build settings from project file to xcconfig file for apollo
1477 http://bugs.webkit.org/show_bug.cgi?id=13198
1479 - Moving build settings from xcode project file to xcconfig files.
1481 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig:
1482 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig:
1483 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
1484 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
1486 2007-03-26 Brady Eidson <beidson@apple.com>
1488 Rubberstamped by Anders and Maciej aand Geoff (oh my!)
1490 Since CFTypeRef is really void*, a RetainPtr couldn't be used.
1491 RefType was "void", which doesn't actually exist as a type.
1492 Since RefType only existed for operator*(), and since that operator
1493 doesn't make any sense for RetainPtr, I removed them!
1495 * kjs/nodes.cpp: Touch this to force a rebuild and (hopefully) help the
1496 compiler with dependencies
1497 * wtf/RetainPtr.h: Nuke RefType and operator*()
1499 2007-03-26 Geoffrey Garen <ggaren@apple.com>
1501 Touched a file to (hopefully) help the compiler with RetainPtr dependencies.
1506 2007-03-24 Brady Eidson <beidson@apple.com>
1510 Whoops, RetainPtr should be in the WTF namespace
1514 2007-03-24 Brady Eidson <beidson@apple.com>
1518 <rdar://problem/5086210> - Move RetainPtr to WTF
1520 * wtf/RetainPtr.h: Added
1521 * JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
1522 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto
1525 2007-03-23 Christopher Brichford <chrisb@adobe.com>
1527 Reviewed/landed by Adam.
1529 Bug 13175: Make apollo mac project files for JavaScriptCore actually
1531 http://bugs.webkit.org/show_bug.cgi?id=13175
1533 - Changing apollo mac project files for JavaScriptCore such that they actually build
1534 JavaScriptCore source code.
1536 * JavaScriptCore.apolloproj/ForwardingSources/grammar.cpp: Added.
1537 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
1538 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
1540 2007-03-24 Mark Rowe <mrowe@apple.com>
1542 Rubber-stamped by Darin.
1544 * Configurations/JavaScriptCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
1546 2007-03-22 Christopher Brichford <chrisb@adobe.com>
1548 Reviewed/landed by Adam.
1550 Bug 13164: Initial version of mac JavaScriptCore project files for
1552 http://bugs.webkit.org/show_bug.cgi?id=13164
1554 - Adding mac project files for apollo port of JavaScriptCore. Currently project
1555 just builds dftables.
1557 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Added.
1558 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Added.
1559 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Added.
1560 * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Added.
1562 2007-03-21 Timothy Hatcher <timothy@apple.com>
1566 <rdar://problem/5076599> JavaScriptCore has a weak export (vtable for KJS::JSCell)
1568 * JavaScriptCore.exp: Remove __ZTVN3KJS6JSCellE.
1570 2007-03-21 Adele Peterson <adele@apple.com>
1574 * API/JSStringRef.cpp: (JSStringIsEqual): Added JSLock.
1576 2007-03-21 Zack Rusin <zrusin@trolltech.com>
1578 Fix the compile when USE(MULTIPLE_THREADS) isn't
1582 (KJS::JSLock::currentThreadIsHoldingLock):
1584 2007-03-20 Maciej Stachowiak <mjs@apple.com>
1586 Reviewed by Geoff and Adam.
1588 - make USE(MULTIPLE_THREADS) support more portable
1589 http://bugs.webkit.org/show_bug.cgi?id=13069
1591 - fixed a threadsafety bug discovered by testing this
1593 - enhanced threadsafety assertions in collector
1595 * API/JSCallbackObject.cpp:
1596 (KJS::JSCallbackObject::~JSCallbackObject): This destructor can't
1597 DropAllLocks around the finalize callback, because it gets called
1598 from garbage collection and we can't let other threads collect!
1600 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1602 (KJS::JSLock::currentThreadIsHoldingLock): Added new function
1603 to allow stronger assertions than just that the lock is held
1604 by some thread (you can now assert that the current thread is
1605 holding it, given the new JSLock design).
1607 * kjs/collector.cpp: Refactored for portability plus added some
1608 stronger assertions.
1609 (KJS::Collector::allocate):
1610 (KJS::currentThreadStackBase):
1611 (KJS::Collector::registerAsMainThread):
1612 (KJS::onMainThread):
1613 (KJS::PlatformThread::PlatformThread):
1614 (KJS::getCurrentPlatformThread):
1615 (KJS::Collector::Thread::Thread):
1616 (KJS::destroyRegisteredThread):
1617 (KJS::Collector::registerThread):
1618 (KJS::Collector::markCurrentThreadConservatively):
1619 (KJS::suspendThread):
1620 (KJS::resumeThread):
1621 (KJS::getPlatformThreadRegisters):
1622 (KJS::otherThreadStackPointer):
1623 (KJS::otherThreadStackBase):
1624 (KJS::Collector::markOtherThreadConservatively):
1625 (KJS::Collector::markStackObjectsConservatively):
1626 (KJS::Collector::protect):
1627 (KJS::Collector::unprotect):
1628 (KJS::Collector::collectOnMainThreadOnly):
1629 (KJS::Collector::markMainThreadOnlyObjects):
1630 (KJS::Collector::collect):
1632 * wtf/FastMalloc.cpp:
1633 (WTF::fastMallocSetIsMultiThreaded):
1634 * wtf/FastMallocInternal.h:
1637 2007-03-19 Darin Adler <darin@apple.com>
1639 * kjs/value.h: Roll ~JSValue change out. It was causing problems. I'll do it right later.
1641 2007-03-19 Geoffrey Garen <ggaren@apple.com>
1643 Reviewed by John Sullivan.
1645 Fixed <rdar://problem/5073380> REGRESSION: Crash occurs at WTF::fastFree()
1646 when reloading liveconnect page (applet)
1648 Best to use free when you use malloc, especially when malloc and delete
1649 use completely different libraries.
1651 * bindings/jni/jni_runtime.cpp:
1652 (JavaMethod::~JavaMethod):
1654 2007-03-19 Andrew Wellington <proton@wiretapped.net>
1658 Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1660 * JavaScriptCore.xcodeproj/project.pbxproj:
1662 2007-03-19 Darin Adler <darin@apple.com>
1666 - Changed list size threshold to 5 based on testing.
1668 I was testing the i-Bench JavaScript with the list statistics
1669 dumping on, and discovered that there were many 5-element lists.
1670 The fast case for lists was for 4 elements and fewer. By changing
1671 the threshold to 5 elements we get a measurable speedup. I believe
1672 this will help real web pages too, not just the benchmark.
1674 * kjs/list.cpp: Change constant from 4 to 5.
1676 2007-03-19 Darin Adler <darin@apple.com>
1678 * kjs/value.h: Oops, fix build.
1680 2007-03-19 Darin Adler <darin@apple.com>
1684 - remove ~JSValue; tiny low-risk performance boost
1686 * kjs/value.h: Remove unneeded empty virtual destructor from JSValue.
1687 The only class derived from JSValue is JSCell and it already has a
1688 virtual destructor. Declaring an empty constructor in JSValue had one
1689 good effect: it marked the destructor private, making it a compile
1690 time error to try to destroy a JSValue; but that's not a likely
1691 mistake for someone to make. It had two bad effects: (1) it caused gcc,
1692 at least, to generate code to fix up the virtual table pointer to
1693 point to the JSValue version of the virtual table inside the destructor
1694 of all classes derived from JSValue directly or indirectly; (2) it
1695 caused JSValue to be a polymorphic class so required a virtual table for
1696 it. It's cleaner to not have either of those.
1698 2007-03-18 Maciej Stachowiak <mjs@apple.com>
1702 - avoid static construction (and global variable access) in a smarter, more portable way,
1703 to later enable MUTLI_THREAD mode to work on other platforms and compilers.
1705 * kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
1706 (KJS::CommonIdentifiers::CommonIdentifiers):
1707 (KJS::CommonIdentifiers::shared):
1708 * kjs/CommonIdentifiers.h: Added.
1711 (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
1712 (KJS::ExecState::ExecState):
1714 * API/JSObjectRef.cpp:
1715 (JSObjectMakeConstructor):
1717 * JavaScriptCore.exp:
1718 * JavaScriptCore.pri:
1719 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1720 * JavaScriptCore.xcodeproj/project.pbxproj:
1721 * JavaScriptCoreSources.bkl:
1722 * bindings/runtime_array.cpp:
1723 (RuntimeArray::getOwnPropertySlot):
1724 (RuntimeArray::put):
1725 * bindings/runtime_method.cpp:
1726 (RuntimeMethod::getOwnPropertySlot):
1727 * kjs/array_object.cpp:
1728 (ArrayInstance::getOwnPropertySlot):
1729 (ArrayInstance::put):
1730 (ArrayInstance::deleteProperty):
1731 (ArrayProtoFunc::ArrayProtoFunc):
1732 (ArrayProtoFunc::callAsFunction):
1733 (ArrayObjectImp::ArrayObjectImp):
1734 * kjs/bool_object.cpp:
1735 (BooleanPrototype::BooleanPrototype):
1736 (BooleanProtoFunc::BooleanProtoFunc):
1737 (BooleanProtoFunc::callAsFunction):
1738 (BooleanObjectImp::BooleanObjectImp):
1740 (KJS::Completion::Completion):
1741 * kjs/date_object.cpp:
1742 (KJS::DateProtoFunc::DateProtoFunc):
1743 (KJS::DateObjectImp::DateObjectImp):
1744 (KJS::DateObjectFuncImp::DateObjectFuncImp):
1745 * kjs/error_object.cpp:
1746 (ErrorPrototype::ErrorPrototype):
1747 (ErrorProtoFunc::ErrorProtoFunc):
1748 (ErrorProtoFunc::callAsFunction):
1749 (ErrorObjectImp::ErrorObjectImp):
1750 (ErrorObjectImp::construct):
1751 (NativeErrorPrototype::NativeErrorPrototype):
1752 (NativeErrorImp::NativeErrorImp):
1753 (NativeErrorImp::construct):
1754 (NativeErrorImp::callAsFunction):
1756 (KJS::FunctionImp::getOwnPropertySlot):
1757 (KJS::FunctionImp::put):
1758 (KJS::FunctionImp::deleteProperty):
1759 (KJS::FunctionImp::getParameterName):
1760 (KJS::DeclaredFunctionImp::construct):
1761 (KJS::IndexToNameMap::unMap):
1762 (KJS::Arguments::Arguments):
1763 (KJS::ActivationImp::getOwnPropertySlot):
1764 (KJS::ActivationImp::deleteProperty):
1765 (KJS::GlobalFuncImp::GlobalFuncImp):
1766 * kjs/function_object.cpp:
1767 (FunctionPrototype::FunctionPrototype):
1768 (FunctionProtoFunc::FunctionProtoFunc):
1769 (FunctionProtoFunc::callAsFunction):
1770 (FunctionObjectImp::FunctionObjectImp):
1771 (FunctionObjectImp::construct):
1773 * kjs/identifier.cpp:
1775 * kjs/interpreter.cpp:
1776 (KJS::Interpreter::init):
1777 (KJS::Interpreter::initGlobalObject):
1778 * kjs/interpreter.h:
1780 * kjs/math_object.cpp:
1781 (MathFuncImp::MathFuncImp):
1783 (ArrayNode::evaluate):
1784 (FuncDeclNode::processFuncDecl):
1785 (FuncExprNode::evaluate):
1786 * kjs/number_object.cpp:
1787 (NumberPrototype::NumberPrototype):
1788 (NumberProtoFunc::NumberProtoFunc):
1789 (NumberObjectImp::NumberObjectImp):
1791 (KJS::JSObject::put):
1792 (KJS::JSObject::defaultValue):
1793 (KJS::JSObject::hasInstance):
1795 (KJS::JSObject::getOwnPropertySlot):
1796 * kjs/object_object.cpp:
1797 (ObjectPrototype::ObjectPrototype):
1798 (ObjectProtoFunc::ObjectProtoFunc):
1799 (ObjectObjectImp::ObjectObjectImp):
1800 * kjs/regexp_object.cpp:
1801 (RegExpPrototype::RegExpPrototype):
1802 (RegExpProtoFunc::RegExpProtoFunc):
1803 (RegExpObjectImp::RegExpObjectImp):
1804 * kjs/string_object.cpp:
1805 (KJS::StringInstance::getOwnPropertySlot):
1806 (KJS::StringInstance::put):
1807 (KJS::StringInstance::deleteProperty):
1808 (KJS::StringPrototype::StringPrototype):
1809 (KJS::StringProtoFunc::StringProtoFunc):
1810 (KJS::StringProtoFunc::callAsFunction):
1811 (KJS::StringObjectImp::StringObjectImp):
1812 (KJS::StringObjectFuncImp::StringObjectFuncImp):
1814 (TestFunctionImp::TestFunctionImp):
1816 2007-03-18 Andrew Wellington <proton@wiretapped.net>
1818 Reviewed by Mark Rowe
1820 Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1822 * JavaScriptCore.xcodeproj/project.pbxproj:
1824 2007-03-19 Mark Rowe <mrowe@apple.com>
1826 Rubber-stamped by Brady.
1828 Update references to bugzilla.opendarwin.org with bugs.webkit.org.
1830 * bindings/c/c_utility.cpp:
1831 (KJS::Bindings::convertUTF8ToUTF16):
1833 (KJS::FunctionImp::callAsFunction):
1835 * kjs/keywords.table:
1837 (KJS::Lexer::shift):
1839 2007-03-18 Geoffrey Garen <ggaren@apple.com>
1841 Reviewed by Oliver Hunt.
1843 Exposed some extra toUInt32 functionality, as part of the fix for
1844 REGRESSION: Incomplete document.all implementation breaks abtelectronics.com
1845 (Style Change Through JavaScript Blanks Content)
1847 * JavaScriptCore.exp:
1849 (KJS::Identifier::toUInt32):
1851 2007-03-18 Geoffrey Garen <ggaren@apple.com>
1853 Removed duplicate export name.
1855 * JavaScriptCore.exp:
1857 2007-03-15 Geoffrey Garen <ggaren@apple.com>
1859 Reviewed by Maciej Stachowiak.
1861 Fixed <rdar://problem/5064964> Repro ASSERT failure in JS Bindings when
1862 closing window @ lowtrades.bptrade.com
1864 Unfortunately, the bindings depend on UString and Identifier as string
1865 representations. So, they need to acquire the JSLock when doing something
1866 that will ref/deref their strings.
1868 Layout tests, the original site, and Java, Flash, and Quicktime on the
1869 web work. No leaks reported. No automated test for this because testing
1870 the Java bindings, like math, is hard.
1872 * bindings/runtime.h: Made Noncopyable, just to be sure.
1874 * bindings/c/c_class.cpp:
1875 (KJS::Bindings::CClass::~CClass): Acquire the JSLock and explicitly clear the keys
1876 in our hashtable, since they're UString::Reps, and ref/deref aren't thread-safe.
1877 (KJS::Bindings::CClass::methodsNamed): Also acquire the JSLock when adding
1878 keys to the table, since the table ref's them.
1879 (KJS::Bindings::CClass::fieldNamed): ditto.
1881 * bindings/c/c_utility.cpp: Removed dead function.
1882 (KJS::Bindings::convertValueToNPVariant): Acquire the JSLock because doing
1883 it recursively is pretty cheap, and it's just too confusing to tell whether
1884 all our callers do it for us.
1885 (KJS::Bindings::convertNPVariantToValue): ditto
1886 * bindings/c/c_utility.h:
1888 * bindings/jni/jni_class.cpp: Same deal as c_class.cpp.
1889 (JavaClass::JavaClass):
1890 (JavaClass::~JavaClass):
1892 * bindings/jni/jni_instance.cpp: Same deal as c_utility.cpp.
1893 (JavaInstance::stringValue):
1894 * bindings/jni/jni_jsobject.cpp:
1895 (JavaJSObject::convertValueToJObject):
1897 * bindings/jni/jni_runtime.cpp:
1898 (JavaMethod::~JavaMethod): Moved from header, for clarity.
1899 (appendClassName): Made this static, so the set of callers is known, and
1900 we can assert that we hold the JSLock. Also changed it to take a UString
1901 reference, which makes the calling code simpler.
1902 (JavaMethod::signature): Store the ASCII value we care about instead of
1903 a UString, since UString is so much more hassle. Hold the JSLock while
1904 building up the temporary UString.
1906 * bindings/jni/jni_runtime.h: Nixed dead code in JavaMethod.
1907 (KJS::Bindings::JavaString::JavaString): Hold a UString::Rep instead of
1908 a UString, so we can acquire the JSLock and explicitly release it.
1909 (KJS::Bindings::JavaString::_commonInit):
1910 (KJS::Bindings::JavaString::~JavaString):
1911 (KJS::Bindings::JavaString::UTF8String):
1912 (KJS::Bindings::JavaString::uchars):
1913 (KJS::Bindings::JavaString::length):
1914 (KJS::Bindings::JavaString::ustring):
1916 * bindings/jni/jni_utility.cpp:
1917 (KJS::Bindings::convertArrayInstanceToJavaArray): Made this static, so
1918 the set of callers is known, and we can assert that we hold the JSLock.
1919 (KJS::Bindings::convertValueToJValue): Acquire the JSLock because doing
1920 it recursively is pretty cheap, and it's just too confusing to tell whether
1921 all our callers do it for us.
1923 * bindings/objc/objc_runtime.h: Nixed some dead code.
1924 * bindings/objc/objc_utility.mm:
1925 (KJS::Bindings::convertNSStringToString): Same drill as above.
1927 2007-03-18 Alexey Proskuryakov <ap@webkit.org>
1931 http://bugs.webkit.org/show_bug.cgi?id=13105
1932 REGRESSION: an exception raised when calculating base value of a dot expression is not returned
1934 Test: fast/js/dot-node-base-exception.html
1937 (FunctionCallDotNode::evaluate): Added the necessary KJS_CHECKEXCEPTIONVALUE.
1939 2007-03-18 Steve Falkenburg <sfalken@apple.com>
1943 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1945 2007-03-17 Timothy Hatcher <timothy@apple.com>
1947 Reviewed by Mark Rowe.
1949 Made Version.xcconfig smarter when building for different configurations.
1950 Now uses the 522+ OpenSource version for Debug and Release, while using the
1951 full 522.4 version for Production builds. The system prefix is also computed
1952 based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
1954 * Configurations/JavaScriptCore.xcconfig:
1955 * Configurations/Version.xcconfig:
1957 2007-03-15 Maciej Stachowiak <mjs@apple.com>
1963 * wtf/TCSystemAlloc.cpp:
1965 2007-03-15 Maciej Stachowiak <mjs@apple.com>
1967 Reviewed by Geoff and Steve.
1969 - fix some portability issues with TCMalloc.
1971 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1973 * wtf/FastMalloc.cpp:
1975 (WTF::InitSizeClasses):
1976 (WTF::TCMalloc_PageHeap::Split):
1977 (WTF::TCMalloc_PageHeap::RegisterSizeClass):
1978 (WTF::TCMalloc_Central_FreeList::length):
1979 (WTF::TCMalloc_ThreadCache::InitTSD):
1980 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
1982 * wtf/TCSystemAlloc.cpp:
1984 (TCMalloc_SystemAlloc):
1986 2007-03-15 Timothy Hatcher <timothy@apple.com>
1990 * Factored out most of our common build settings into .xcconfig files. Anything that was common in
1991 each build configuration was factored out into the shared .xcconfig file.
1992 * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
1993 * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
1994 * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
1996 * Configurations/Base.xcconfig: Added.
1997 * Configurations/DebugRelease.xcconfig: Added.
1998 * Configurations/JavaScriptCore.xcconfig: Added.
1999 * Configurations/Version.xcconfig: Added.
2001 * JavaScriptCore.xcodeproj/project.pbxproj:
2003 2007-03-16 Shrikant Gangoda <shrikant.gangoda@celunite.com>
2007 * kjs/DateMath.cpp: gettimeofday comes from <sys/time.h> on Linux.
2009 2007-03-14 Kevin McCullough <kmccullough@apple.com>
2013 - Fixed one more build breakage
2015 * kjs/date_object.cpp:
2016 (KJS::formatLocaleDate):
2018 2007-03-14 Kevin McCullough <kmccullough@apple.com>
2022 - Fixed a build breakage.
2025 * kjs/date_object.cpp:
2026 (KJS::formatLocaleDate):
2027 (KJS::DateObjectImp::construct):
2029 2007-03-14 Kevin McCullough <kmccullough@apple.com>
2033 - rdar://problem/5045720
2034 - DST changes in US affect JavaScript date calculations (12975)
2035 This fix was to ensure we properly test for the new changes to DST in the US.
2036 Also this fixes when we apply DST, now we correctly map most past years to current
2037 DST rules. We still have a small issue with years before 1900 or after 2100.
2038 rdar://problem/5055038
2040 * kjs/DateMath.cpp: Fix DST to match spec better.
2041 (KJS::getCurrentUTCTime):
2042 (KJS::mimimumYearForDST):
2043 (KJS::maximumYearForDST):
2044 (KJS::equivalentYearForDST):
2045 (KJS::getDSTOffset):
2046 * kjs/DateMath.h: Consolodated common funtionality.
2047 * kjs/date_object.cpp: Consolodated common functionality.
2048 (KJS::formatLocaleDate):
2049 (KJS::DateObjectImp::construct):
2050 * tests/mozilla/ecma/jsref.js: Added functions for finding the correct days when DST starts and ends.
2051 * tests/mozilla/ecma/shell.js: Added back in the old DST functions for ease of merging with mozilla if needed.
2052 * tests/mozilla/ecma_2/jsref.js: Added functions for finding the correct days when DST starts and ends.
2053 * tests/mozilla/ecma_3/Date/shell.js: Added functions for finding the correct days when DST starts and ends.
2054 * tests/mozilla/expected.html: Updated to show all date tests passing.
2056 === Safari-5522.4 ===
2058 2007-03-13 Kevin McCullough <kmccullough@apple.com>
2062 - Adding expected failures until the are truly fixed.
2063 - rdar://problem/5060302
2065 * tests/mozilla/expected.html:
2067 2007-03-12 Kevin McCullough <kmccullough@apple.com>
2071 - Actually update tests for new DST rules.
2073 * tests/mozilla/ecma/Date/15.9.3.1-1.js:
2074 * tests/mozilla/ecma/Date/15.9.3.1-2.js:
2075 * tests/mozilla/ecma/Date/15.9.3.1-3.js:
2076 * tests/mozilla/ecma/Date/15.9.3.1-4.js:
2077 * tests/mozilla/ecma/Date/15.9.3.1-5.js:
2078 * tests/mozilla/ecma/Date/15.9.3.2-1.js:
2079 * tests/mozilla/ecma/Date/15.9.3.2-2.js:
2080 * tests/mozilla/ecma/Date/15.9.3.2-3.js:
2081 * tests/mozilla/ecma/Date/15.9.3.2-4.js:
2082 * tests/mozilla/ecma/Date/15.9.3.2-5.js:
2083 * tests/mozilla/ecma/Date/15.9.3.8-1.js:
2084 * tests/mozilla/ecma/Date/15.9.3.8-2.js:
2085 * tests/mozilla/ecma/Date/15.9.3.8-3.js:
2086 * tests/mozilla/ecma/Date/15.9.3.8-4.js:
2087 * tests/mozilla/ecma/Date/15.9.3.8-5.js:
2088 * tests/mozilla/ecma/Date/15.9.5.10-1.js:
2089 * tests/mozilla/ecma/Date/15.9.5.10-10.js:
2090 * tests/mozilla/ecma/Date/15.9.5.10-11.js:
2091 * tests/mozilla/ecma/Date/15.9.5.10-12.js:
2092 * tests/mozilla/ecma/Date/15.9.5.10-13.js:
2093 * tests/mozilla/ecma/Date/15.9.5.10-2.js:
2094 * tests/mozilla/ecma/Date/15.9.5.10-3.js:
2095 * tests/mozilla/ecma/Date/15.9.5.10-4.js:
2096 * tests/mozilla/ecma/Date/15.9.5.10-5.js:
2097 * tests/mozilla/ecma/Date/15.9.5.10-6.js:
2098 * tests/mozilla/ecma/Date/15.9.5.10-7.js:
2099 * tests/mozilla/ecma/Date/15.9.5.10-8.js:
2100 * tests/mozilla/ecma/Date/15.9.5.10-9.js:
2101 * tests/mozilla/ecma/jsref.js:
2102 * tests/mozilla/ecma_2/jsref.js:
2103 * tests/mozilla/ecma_3/Date/shell.js:
2105 2007-03-12 Kevin McCullough <kmccullough@apple.com>
2109 - Update tests for new DST rules.
2111 * tests/mozilla/ecma/shell.js:
2113 2007-03-11 Geoffrey Garen <ggaren@apple.com>
2115 Reviewed by Oliver Hunt.
2117 Fixed <rdar://problem/4681051> Installer crashes in KJS::Collector::
2118 markOtherThreadConservatively(KJS::Collector::Thread*) trying to install
2119 iLife 06 using Rosetta on an Intel Machine
2121 The problem was that our thread-specific data destructor would modify the
2122 list of active JavaScript threads without holding the JSLock, corrupting
2123 the list. Corruption was especially likely if one JavaScript thread exited
2124 while another was starting up.
2126 * JavaScriptCore.exp:
2127 * kjs/JSLock.cpp: Don't conflate locking the JSLock with registering a
2128 thread, since the thread-specific data destructor needs to lock
2129 without registering a thread. Instead, treat thread registration as a
2130 part of the convenience of the JSLock object, and whittle down JSLock::lock()
2131 to just the bits that actually do the locking.
2132 (KJS::JSLock::lock):
2133 (KJS::JSLock::registerThread):
2134 * kjs/JSLock.h: Updated comments to mention the new behavior above, and
2135 other recent changes.
2136 (KJS::JSLock::JSLock):
2137 * kjs/collector.cpp:
2138 (KJS::destroyRegisteredThread): Lock here.
2139 (KJS::Collector::registerThread): To match, assert that we're locked here.
2141 2007-03-10 Geoffrey Garen <ggaren@apple.com>
2143 Reviewed by Darin Adler.
2145 Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and
2146 JSCore causes a hang @ www.panoramas.dk
2148 With a PAC file, run-webkit-tests --threaded passes, the reported site
2149 works, and all the Quicktime/JavaScript and Flash/JavaScript examples
2150 I found through Google work, too.
2152 Any time JavaScript causes arbitrary non-JavaScript code to execute, it
2153 risks deadlock, because that code may block, trying to acquire a lock
2154 owned by a thread that is waiting to execute JavaScript. In this case,
2155 the thread was a networking thread that was waiting to interpret a PAC file.
2157 Because non-JavaScript code may execute in response to, well, anything,
2158 a perfect solution to this problem is impossible. I've implemented an
2159 optimistic solution, instead: JavaScript will drop its lock whenever it
2160 makes a direct call to non-JavaScript code through a bridging/plug-in API,
2161 but will blissfully ignore the indirect ways it may cause non-JavaScript
2162 code to run (resizing a window, for example).
2164 Unfortunately, this solution introduces significant locking overhead in
2165 the bridging APIs. I don't see a way around that.
2167 This patch includes some distinct bug fixes I saw along the way:
2169 * bindings/objc/objc_instance.mm: Fixed a bug where a nested begin() call
2170 would leak its autorelease pool, because it would NULL out _pool without
2173 * bindings/runtime_object.cpp:
2174 (RuntimeObjectImp::methodGetter): Don't copy an Identifier to ASCII only
2175 to turn around and make an Identifier from the ASCII. In an earlier
2176 version of this patch, the copy caused an assertion failure. Now it's
2177 just unnecessary work.
2178 (RuntimeObjectImp::getOwnPropertySlot): ditto
2180 * bindings/objc/objc_instance.h: Removed overrides of setVAlueOfField and
2181 getValueOfField, because they did exactly what the base class versions did.
2182 Removed overrides of Noncopyable declarations for the same reason.
2184 * bindings/runtime.h: Inherit from Noncopyable instead of rolling our own.
2185 * bindings/c/c_instance.h: ditto
2187 And the actual patch:
2189 * API/JSCallbackConstructor.cpp: Drop all locks when calling out to C.
2190 (KJS::JSCallbackConstructor::construct):
2191 * API/JSCallbackFunction.cpp: ditto
2192 (KJS::JSCallbackFunction::callAsFunction):
2193 * API/JSCallbackObject.cpp: ditto
2194 (KJS::JSCallbackObject::init):
2195 (KJS::JSCallbackObject::~JSCallbackObject):
2196 (KJS::JSCallbackObject::getOwnPropertySlot):
2197 (KJS::JSCallbackObject::put):
2198 (KJS::JSCallbackObject::deleteProperty):
2199 (KJS::JSCallbackObject::construct):
2200 (KJS::JSCallbackObject::hasInstance):
2201 (KJS::JSCallbackObject::callAsFunction):
2202 (KJS::JSCallbackObject::getPropertyNames):
2203 (KJS::JSCallbackObject::toNumber):
2204 (KJS::JSCallbackObject::toString):
2205 (KJS::JSCallbackObject::staticValueGetter):
2206 (KJS::JSCallbackObject::callbackGetter):
2208 * bindings/c/c_instance.cpp: Drop all locks when calling out to C.
2209 (KJS::Bindings::CInstance::invokeMethod):
2210 (KJS::Bindings::CInstance::invokeDefaultMethod):
2211 * bindings/c/c_runtime.cpp: Drop all locks when calling out to C.
2212 (KJS::Bindings::CField::valueFromInstance):
2213 (KJS::Bindings::CField::setValueToInstance):
2214 * bindings/jni/jni_objc.mm:
2215 (KJS::Bindings::dispatchJNICall): Drop all locks when calling out to Java.
2217 * bindings/objc/objc_instance.mm: The changes here are to accomodate the
2218 fact that C++ unwinding of DropAllLocks goes crazy when you put it inside
2219 a @try block. I moved all JavaScript stuff outside of the @try blocks, and
2220 then prefixed the whole blocks with DropAllLocks objects. This required some
2221 supporting changes in other functions, which now acquire the JSLock for
2222 themselves, intead of relying on their callers to do so.
2223 (ObjcInstance::end):
2224 (ObjcInstance::invokeMethod):
2225 (ObjcInstance::invokeDefaultMethod):
2226 (ObjcInstance::setValueOfUndefinedField):
2227 (ObjcInstance::getValueOfUndefinedField):
2228 * bindings/objc/objc_runtime.mm: Same as above, except I didn't want to
2229 change throwError to acquire the JSLock for itself.
2230 (ObjcField::valueFromInstance):
2231 (ObjcField::setValueToInstance):
2232 * bindings/objc/objc_utility.mm: Supporting changes mentioned above.
2233 (KJS::Bindings::convertValueToObjcValue):
2234 (KJS::Bindings::convertObjcValueToValue):
2237 (1) Fixed DropAllLocks to behave as advertised, and drop the JSLock only
2238 if the current thread actually acquired it in the first place. This is
2239 important because WebKit needs to ensure that the JSLock has been
2240 dropped before it makes a plug-in call, even though it doesn't know if
2241 the current thread actually acquired the JSLock. (We don't want WebKit
2242 to accidentally drop a lock belonging to *another thread*.)
2243 (2) Used the new per-thread code written for (1) to make recursive calls
2244 to JSLock very cheap. JSLock now knows to call pthread_mutext_lock/
2245 pthread_mutext_unlock only at nesting level 0.
2246 (KJS::createDidLockJSMutex):
2247 (KJS::JSLock::lock):
2248 (KJS::JSLock::unlock):
2249 (KJS::DropAllLocks::DropAllLocks):
2250 (KJS::DropAllLocks::~DropAllLocks):
2251 (KJS::JSLock::lockCount):
2252 * kjs/JSLock.h: Don't duplicate Noncopyable.
2253 (KJS::JSLock::~JSLock):
2255 * wtf/Assertions.h: Blind attempt at helping the Windows build.
2257 2007-03-08 MorganL <morganl.webkit@yahoo.com>
2261 http://bugs.webkit.org/show_bug.cgi?id=13018
2262 Bug 13018: allow embedders to override the definition of CRASH.
2264 * wtf/Assertions.h: make it possible to override CRASH.
2266 2007-03-07 Anrong Hu <huanr@yahoo.com>
2270 Fix http://bugs.webkit.org/show_bug.cgi?id=12535
2271 Bug 12535: Stack-optimizing compilers can trick GC into freeing in-use objects
2274 (KJS::StringImp::toObject): Copy val onto the stack so it is not subject to garbage collection.
2276 2007-03-07 Geoffrey Garen <ggaren@apple.com>
2278 Build fix for non-multiple-thread folks.
2280 Use a shared global in the non-multiple-thread case.
2282 * wtf/FastMalloc.cpp:
2284 (WTF::fastMallocForbid):
2285 (WTF::fastMallocAllow):
2287 2007-03-07 Geoffrey Garen <ggaren@apple.com>
2289 Reviewed by Darin Adler.
2291 Fixed ASSERT failure I just introduced.
2293 Made the fastMalloc isForbidden flag per thread. (Oops!) We expect that
2294 other threads will malloc while we're marking -- we just want to prevent
2295 our own marking from malloc'ing.
2297 * wtf/FastMalloc.cpp:
2298 (WTF::initializeIsForbiddenKey):
2300 (WTF::fastMallocForbid):
2301 (WTF::fastMallocAllow):
2308 2007-03-07 Shrikant Gangoda <shrikant.gangoda@celunite.com>
2312 http://bugs.webkit.org/show_bug.cgi?id=12997
2314 Wrap pthread-specific assertion in #if USE(MULTIPLE_THREADS).
2316 * kjs/collector.cpp:
2317 (KJS::Collector::markMainThreadOnlyObjects):
2319 2007-03-06 Geoffrey Garen <ggaren@apple.com>
2321 Reviewed by Maciej Stachowiak.
2323 Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586
2324 PAC file: malloc deadlock sometimes causes a hang @ www.apple.com/pro/profiles/ (12586)
2326 This is a modified version of r14752 on the branch.
2328 These changes just add debugging functionality. They ASSERT that we don't
2329 malloc during the mark phase of a garbage collection, which can cause a
2332 * kjs/collector.cpp:
2333 (KJS::Collector::collect):
2334 * wtf/FastMalloc.cpp:
2335 (WTF::fastMallocForbid):
2336 (WTF::fastMallocAllow):
2344 2007-03-06 Geoffrey Garen <ggaren@apple.com>
2346 Reviewed by Maciej Stachowiak.
2348 Fixed all known crashers exposed by run-webkit-tests --threaded. This covers:
2350 <rdar://problem/4565394> | http://bugs.webkit.org/show_bug.cgi?id=12585
2351 PAC file: after closing a window that contains macworld.com, new window
2352 crashes (KJS::PropertyMap::mark()) (12585)
2353 <rdar://problem/4571215> | http://bugs.webkit.org/show_bug.cgi?id=9211
2354 PAC file: Crash occurs when clicking on the navigation tabs at http://www.businessweek.com/ (9211)
2355 <rdar://problem/4557926>
2356 PAC file: Crash occurs when attempting to view image in slideshow mode
2357 at http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute (KJS::
2358 ExecState*) + 312) if you use a PAC file
2360 (1) Added some missing JSLocks, along with related ASSERTs.
2362 (2) Fully implemented support for objects that can only be garbage collected
2363 on the main thread. So far, only WebCore uses this. We can add it to API
2364 later if we learn that it's needed.
2366 The implementation uses a "main thread only" flag inside each object. When
2367 collecting on a secondary thread, the Collector does an extra pass through
2368 the heap to mark all flagged objects before sweeping. This solution makes
2369 the common case -- flag lots of objects, but never collect on a secondary
2370 thread -- very fast, even though the uncommon case of garbage collecting
2371 on a secondary thread isn't as fast as it could be. I left some notes
2372 about how to speed it up, if we ever care.
2374 For posterity, here are some things I learned about GC while investigating:
2376 * Each collect must either mark or delete every heap object. "Zombie"
2377 objects, which are neither marked nor deleted, raise these issues:
2379 * On the next pass, the conservative marking algorithm might mark a
2380 zombie, causing it to mark freed objects.
2382 * The client might try to use a zombie, which would seem live because
2383 its finalizer had not yet run.
2385 * A collect on the main thread is free to delete any object. Presumably,
2386 objects allocated on secondary threads have thread-safe finalizers.
2388 * A collect on a secondary thread must not delete thread-unsafe objects.
2390 * The mark function must be thread-safe.
2392 Line by line comments:
2394 * API/JSObjectRef.h: Added comment specifying that the finalize callback
2395 may run on any thread.
2397 * JavaScriptCore.exp: Nothing to see here.
2399 * bindings/npruntime.cpp:
2400 (_NPN_GetStringIdentifier): Added JSLock.
2402 * bindings/objc/objc_instance.h:
2403 * bindings/objc/objc_instance.mm:
2404 (ObjcInstance::~ObjcInstance): Use an autorelease pool. The other callers
2405 to CFRelease needed one, too, but they were dead code, so I removed them
2406 instead. (This fixes a leak seen while running run-webkit-tests --threaded,
2407 although I don't think it's specifically a threading issue.)
2409 * kjs/collector.cpp:
2410 (KJS::Collector::collectOnMainThreadOnly): New function. Tells the collector
2411 to collect a value only if it's collecting on the main thread.
2412 (KJS::Collector::markMainThreadOnlyObjects): New function. Scans the heap
2413 for "main thread only" objects and marks them.
2415 * kjs/date_object.cpp:
2416 (KJS::DateObjectImp::DateObjectImp): To make the new ASSERTs happy, allocate
2417 our globals on the heap, avoiding a seemingly unsafe destructor call at
2419 * kjs/function_object.cpp:
2420 (FunctionPrototype::FunctionPrototype): ditto
2422 * kjs/interpreter.cpp:
2423 (KJS::Interpreter::mark): Removed boolean parameter, which was an incomplete
2424 and arguably hackish way to implement markMainThreadOnlyObjects() inside WebCore.
2425 * kjs/interpreter.h:
2427 * kjs/identifier.cpp:
2428 (KJS::identifierTable): Added some ASSERTs to check for thread safety
2431 * kjs/list.cpp: Added some ASSERTs to check for thread safety problems.
2432 (KJS::allocateListImp):
2433 (KJS::List::release):
2434 (KJS::List::append):
2435 (KJS::List::empty): Make the new ASSERTs happy.
2438 (KJS::JSObject::JSObject): "m_destructorIsThreadSafe" => "m_collectOnMainThreadOnly".
2439 I removed the constructor parameter because m_collectOnMainThreadOnly,
2440 like m_marked, is a Collector bit, so only the Collector should set or get it.
2442 * kjs/object_object.cpp:
2443 (ObjectPrototype::ObjectPrototype): Make the ASSERTs happy.
2444 * kjs/regexp_object.cpp:
2445 (RegExpPrototype::RegExpPrototype): ditto
2447 * kjs/ustring.cpp: Added some ASSERTs to check for thread safety problems.
2448 (KJS::UCharReference::ref):
2449 (KJS::UString::Rep::createCopying):
2450 (KJS::UString::Rep::create):
2451 (KJS::UString::Rep::destroy):
2452 (KJS::UString::null): Make the new ASSERTs happy.
2454 (KJS::UString::Rep::ref): Added some ASSERTs to check for thread safety problems.
2455 (KJS::UString::Rep::deref):
2458 (KJS::JSCell::JSCell):
2460 2007-03-06 Geoffrey Garen <ggaren@apple.com>
2462 Reviewed by Maciej Stachowiak.
2464 2% speedup on super accurate JS iBench.
2466 (KJS::Collector::collect): Removed anti-optimization to call
2467 pthread_is_threaded_np() before calling pthread_main_np(). Almost all
2468 apps have more than one thread, so the extra call is actually worse.
2469 Interestingly, even the single-threaded testkjs shows a speed gain
2470 from removing the pthread_is_threaded_np() short-circuit. Not sure why.
2472 2007-03-04 Don Gibson <dgibson77@gmail.com>
2474 Reviewed by Nikolas Zimmermann.
2476 - fix http://bugs.webkit.org/show_bug.cgi?id=12950
2477 Assertions.cpp should not #define macros that are already defined
2479 * wtf/Assertions.cpp: Don't #define WINVER and _WIN32_WINNT if they
2480 are already defined.
2482 2007-03-02 Steve Falkenburg <sfalken@apple.com>
2486 Add unsigned int hash traits (matches existing unsigned long version)
2491 2007-03-02 Adam Roben <aroben@apple.com>
2493 Reviewed by Kevin M.
2495 Try to fix the Qt build.
2498 (KJS::msToGregorianDateTime): Removed unnecessary "struct" keyword.
2499 * kjs/DateMath.h: Moved forward declarations to the top of the file
2500 before they are used.
2501 * kjs/date_object.cpp:
2502 (KJS::formatLocaleDate): Changed to take a const GregorianDateTime&
2503 since GregorianDateTime is Noncopyable.
2505 2007-03-02 Darin Adler <darin@apple.com>
2507 Reviewed by Kevin McCullough.
2509 - fix http://bugs.webkit.org/show_bug.cgi?id=12867
2510 REGRESSION: BenchJS test 7 (dates) is 220% slower than in Safari 2.0.4
2512 * kjs/DateMath.h: Marked GregorianDateTime as noncopyable, since it has a non-trivial
2513 destructor and not the correspoding copy constructor or assignment operator.
2514 Changed the GregorianDateTime constructor to use member initialization syntax.
2515 Fixed the destructor to use the array delete operator, since timeZone is an array.
2518 (KJS::daysInYear): Changed to call isLeapYear so the rule is not repeated twice.
2519 (KJS::getUTCOffset): Added caching on PLATFORM(DARWIN), since we can rely on the
2520 notify_check function and "com.apple.system.timezone" to let us know when the
2523 2007-02-27 Geoffrey Garen <ggaren@apple.com>
2525 Reviewed by Darin Adler.
2527 Follow-up to fixing http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
2528 JS objects not collected after closing window @ ebay.com/maps.google.com
2530 Changed Interpreter cache of global constructors and prototypes from
2531 ProtectedPtrs to bare, marked pointers. ProtectedPtrs are inefficient,
2532 and they increase the risk of reference cycles. Also, Darin said something
2533 about ProtectedPtrs giving him warts.
2535 Also changed data members to precise types from generic JSObject*'s.
2537 Layout tests and JS tests pass.
2539 * kjs/SavedBuiltins.h:
2540 * kjs/interpreter.cpp:
2541 (KJS::Interpreter::init):
2542 (KJS::Interpreter::~Interpreter):
2543 (KJS::Interpreter::initGlobalObject): Moved Identifier::init() call to
2544 constructor, for clarity.
2545 (KJS::Interpreter::mark):
2546 * kjs/interpreter.h:
2548 2007-02-27 Geoffrey Garen <ggaren@apple.com>
2550 Reviewed by Maciej Stachowiak.
2552 Fixed http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
2553 JS objects not collected after closing window @ ebay.com/maps.google.com
2555 Don't GC in the Interpreter destructor. For that to work, the Interpreter
2556 would have to NULL out all of its ProtectedPtrs before calling collect(). But
2557 we've decided that we don't want things to work that way, anyway. We want the
2558 client to be in charge of manual GC so that it can optimize cases when
2559 it will be destroying many interpreters at once
2560 (e.g., http://bugs.webkit.org/show_bug.cgi?id=12900).
2562 Also removed Interpreter::collect() because it was redundant with
2563 Collector::collect().
2565 * JavaScriptCore.exp:
2566 * kjs/interpreter.cpp:
2567 (KJS::Interpreter::~Interpreter):
2569 (TestFunctionImp::callAsFunction):
2571 2007-02-26 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2573 Reviewed by Adam Roben.
2575 Rename *_SUPPORT defines to ENABLE_*.
2579 2007-02-26 Maciej Stachowiak <mjs@apple.com>
2583 - <rdar://problem/5021698> Disable experimental SVG features (12883)
2585 * wtf/Platform.h: Add ENABLE() macro similar to HAVE() and USE(), to
2586 allow nicer handling of optional WebKit features.
2588 2007-02-22 George Staikos <staikos@kde.org>
2594 * wtf/unicode/qt4/UnicodeQt4.h:
2595 (WTF::Unicode::toLower):
2596 (WTF::Unicode::toUpper):
2598 2007-02-22 Oscar Cwajbaum <public@oscarc.net>
2602 Fix ARM-specific alignment problem in FastMalloc
2603 http://bugs.webkit.org/show_bug.cgi?id=12841
2605 * wtf/FastMalloc.cpp:
2606 Modify how pageheap_memory is declared to ensure proper alignment
2607 on architectures such as ARM
2609 2007-02-20 Zack Rusin <zrusin@trolltech.com>
2613 Make sure that non-void methods always return something.
2615 * wtf/unicode/qt4/UnicodeQt4.h:
2616 (WTF::Unicode::toLower):
2617 (WTF::Unicode::toUpper):
2618 (WTF::Unicode::foldCase):
2620 2007-02-18 Kevin Ollivier <kevino@theolliviers.com>
2622 Reviewed by Adam Roben.
2624 Fix cases where MSVC-specific code was identified as Win32 platform
2625 code. (as it should be compiled for e.g. wx port when using MSVC too)
2629 * wtf/StringExtras.h:
2630 changed PLATFORM(WIN) sections to COMPILER(MSVC) as necessary
2632 2007-02-17 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2634 Reviewed by Adam Roben.
2636 Fix crashes on ARM due to different struct packing. Based on a patch
2638 * kjs/ustring.cpp: compile-time assert to make sure sizeof(UChar) == 2
2639 * kjs/ustring.h: pack UChar struct to ensure that sizeof(UChar) == 2
2640 * wtf/Assertions.h: add COMPILE_ASSERT macro for compile-time assertions
2642 2007-02-16 George Staikos <staikos@kde.org>
2646 Fix uninitialized variable
2648 * bindings/testbindings.cpp:
2651 2007-02-16 Anders Carlsson <acarlsson@apple.com>
2655 http://bugs.webkit.org/show_bug.cgi?id=12788
2656 REGRESSION: Going back one page in history has a noticeable delay
2658 Um...if all elements in two vectors are equal, then I guess we could say that
2659 the two vectors are equal too.
2664 2007-02-14 Anders Carlsson <acarlsson@apple.com>
2668 Add new canCompareWithMemcmp vector trait and use it to determine whether
2669 operator== can use memcmp.
2673 (WTF::VectorTypeOperations::compare):
2675 * wtf/VectorTraits.h:
2678 2007-02-13 Brady Eidson <beidson@apple.com>
2682 Tweaked vector a bit
2687 2007-02-13 Dex Deacon <occupant4@gmail.com>
2691 - fix for http://bugs.webkit.org/show_bug.cgi?id=12750
2692 Vector operator== was not defined correctly. It returned void,
2693 did not accept const Vectors, and used an int instead of size_t.
2695 * wtf/Vector.h: fixed comparison operators
2699 2007-02-10 David Carson <dacarson@gmail.com>
2703 - fix for http://bugs.webkit.org/show_bug.cgi?id=12636
2704 Corrected the generation of method signatures when the parameter
2706 Added support for converting a Javascript array to a Java array.
2708 * bindings/jni/jni_utility.h: added new type for array, array_type
2709 * bindings/jni/jni_runtime.cpp: add support for new array type
2710 (JavaField::valueFromInstance):
2711 (JavaField::setValueToInstance):
2712 (JavaMethod::JavaMethod):
2713 (JavaMethod::signature):
2714 * bindings/jni/jni_utility.cpp: add support for new array type
2715 (KJS::Bindings::callJNIMethod):
2716 (KJS::Bindings::callJNIStaticMethod):
2717 (KJS::Bindings::callJNIMethodIDA):
2718 (KJS::Bindings::JNITypeFromClassName):
2719 (KJS::Bindings::signatureFromPrimitiveType):
2720 (KJS::Bindings::JNITypeFromPrimitiveType):
2721 (KJS::Bindings::getJNIField):
2722 (KJS::Bindings::convertArrayInstanceToJavaArray): new method
2723 converts the Javascript array to the requested Java array.
2724 (KJS::Bindings::convertValueToJValue):
2726 2007-02-08 Anders Carlsson <acarlsson@apple.com>
2730 <rdar://problem/4930614>
2731 Safari complains about "Slow Script" if GMail is left open and machine is busy
2733 <rdar://problem/4649516>
2734 Turn off slow script dialog or crank up time that makes it come up
2736 <rdar://problem/4963589>
2737 Slow script warning is displayed after closing of PROMPT or PRINT dialog
2739 Re-do the way script timeouts are handled. No longer use a unix timer that sends signals. Instead, add a
2740 tick count and increment it in loop bodies. If the tick count reaches a threshold, do a timeout check. If the total time executing
2741 is higher than the timeout value, (possibly) interrupt the script. The timeout checker also adjusts the threshold dynamically
2742 to prevent doing the timeout check too often.
2744 * JavaScriptCore.exp:
2745 Remove pause and resume calls.
2747 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2750 * kjs/interpreter.cpp:
2751 (KJS::Interpreter::init):
2752 (KJS::Interpreter::~Interpreter):
2753 (KJS::Interpreter::startTimeoutCheck):
2754 (KJS::Interpreter::stopTimeoutCheck):
2755 (KJS::Interpreter::resetTimeoutCheck):
2756 (KJS::getCurrentTime):
2757 (KJS::Interpreter::checkTimeout):
2758 * kjs/interpreter.h:
2759 (KJS::Interpreter::timedOut):
2761 (DoWhileNode::execute):
2762 (WhileNode::execute):
2765 2007-02-07 Darin Adler <darin@apple.com>
2767 * JavaScriptCore.vcproj/JavaScriptCore.sln: Reenable testkjs.
2769 2007-02-07 Darin Adler <darin@apple.com>
2773 - another build fix; this time for sure
2775 * pcre/pcre_exec.c: (match):
2776 The compiler caught an incorrect use of the othercase variable across
2777 a call to RMATCH in character repeat processing. Local variables can
2778 change in the crazy NO_RECURSE mode that we use, so we instead need
2779 the value in othercase to be in one of the special stack frame variables.
2780 Added a new stack frame variable for this purpose named repeat_othercase.
2781 Also noted a similar error in the non-UTF-16 side of the #ifdef, but
2782 didn't try to fix that one. Also removed a SUPPORT_UCP #ifdef from the
2783 PCRE_UTF16 side; that code doesn't work without the Unicde properties
2784 table, and we don't try to use it that way.
2786 2007-02-06 Steve Falkenburg <sfalken@apple.com>
2788 Disable testkjs in sln until we figure out mysterious compiler warning.
2790 * JavaScriptCore.vcproj/JavaScriptCore.sln:
2792 2007-02-06 Steve Falkenburg <sfalken@apple.com>
2799 2007-02-06 Darin Adler <darin@apple.com>
2803 - fix <rdar://problem/4979089> PCRE should avoid setjmp/longjmp even when compiler
2806 Added a new code path that's slower and way uglier but doesn't rely on GCC's
2809 * pcre/pcre_exec.c: Added a numeric parameter to the RMATCH function. It must be
2810 different at every RMATCH call site. Changed the non-GCC NO_RECURSE version of
2811 the macro to use a label incorporating the number. Changed the RRETURN macro to
2812 use a goto instead of longjmp.
2813 (match): Added a different number at each callsite, using a perl script for the
2814 first-time task. Going forward it should be easy to maintain by hand. Added a
2815 switch statement at the bottom of the function. We'll get compile time errors
2816 if we have anything in the switch statement that's never used in an RMATCH,
2817 but errors in the other direction are silent except at runtime.
2819 2007-02-06 Darin Adler <darin@apple.com>
2823 - fix <rdar://problem/4687840> 9A241: JavaScript RegExp 25-30x slower than on 10.4.7
2825 I used Shark to figure out what to do. The test case is now 15% faster than with
2826 stock Safari. Some other regular expression cases might still be a few % slower
2827 than before, but the >10x slowdown is now completely gone.
2829 1) Fix slowness caused by setjmp/longjmp by using computed goto instead.
2831 Use GCC extensions - locally declared labels, labels as values, and computed goto -
2832 instead of using setjmp/longjmp to implemement non-recursive version of the regular
2833 expression system. We could probably make this even faster if we reduced the use
2834 of malloc a bit too.
2836 2) Fix slowness caused by allocating heapframe objects by allocating the first
2837 16 of them from the stack.
2839 3) Speed up use of malloc and free in PCRE by making it use fastMalloc and fastFree.
2841 4) Speed up the test case by adding a special case to a UString function.
2843 5) Made a small improvement to the innermost hottest loop of match by hoisting
2844 the conversion from int to pcre_uchar out of the loop.
2846 * JavaScriptCore.xcodeproj/project.pbxproj: Compile FastMallocPCRE.cpp, and don't
2847 compile pcre_globals.c.
2849 * wtf/FastMallocPCRE.cpp: Added. A copy of pcre_globals.c that uses FastMalloc.h.
2850 This is better than code that sets the PCRE allocation globals because by doing it
2851 this way there's guaranteed to be no problem with order of initialization.
2853 * kjs/ustring.cpp: (KJS::UString::spliceSubstringsWithSeparators): Add a fast
2854 special case when this is called for only one subrange and no seaprators. This
2855 was happening a lot in the test case and it seems quite reasonable to optimize this.
2857 * pcre/pcre_exec.c: Create a copy of the RMATCH and RRETURN macros that use goto
2858 instead of setjmp/longjmp. Change code that calls pcre_stack_malloc to first use
2859 storage on the stack inside the match function.
2860 (match): Move initialization of utf8 up a couple lines to avoid "possibly used
2861 uninitialized" warning. Use a local variable so we compare with pcre_uchar instead
2862 of with int inside the inner "find a character" loop.
2864 2007-02-03 George Staikos <staikos@kde.org>
2868 -1 is not a valid point. We can't handle anything > 0xffff anyway.
2869 Fixes crash on cases like eval("x");
2871 * wtf/unicode/qt4/UnicodeQt4.h:
2872 (WTF::Unicode::category):
2874 2007-02-02 Darin Adler <darin@apple.com>
2878 - fix copying and assigning a ListHashSet
2880 No test because the code path with bugs I am fixing is not used yet.
2882 * wtf/ListHashSet.h: Tweaked ListHashSetNodeAllocator a little bit for clarity.
2883 Changed m_allocator to be an OwnPtr instead of doing an explicit delete.
2884 Fixed bug in copy constructor where we'd have an uninitialized m_allocator.
2885 Fixed bug in assignment operator where it would swap only the hash table, and
2886 not the head, tail, and allocator pointers.
2888 2007-02-02 Geoffrey Garen <ggaren@apple.com>
2890 Reviewed by Maciej Stachowiak.
2892 Use WTFLog instead of fprintf for logging KJS::Node leaks.
2895 (NodeCounter::~NodeCounter): Changed count to unsigned, updated
2896 to match style guidelines.
2898 2007-02-02 Maciej Stachowiak <mjs@apple.com>
2900 - not reviewed, build fix
2902 * wtf/ListHashSet.h:
2903 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): ummm, use union correctly
2905 2007-02-01 Maciej Stachowiak <mjs@apple.com>
2909 - use a custom allocator for ListHashSet, to fix ~1% perf regression using it for form control
2911 * wtf/ListHashSet.h:
2912 (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator):
2913 (WTF::ListHashSetNodeAllocator::allocate):
2914 (WTF::ListHashSetNodeAllocator::deallocate):
2915 (WTF::ListHashSetNode::operator new):
2916 (WTF::ListHashSetNode::operator delete):
2917 (WTF::ListHashSetNode::destroy):
2918 (WTF::ListHashSetTranslator::translate):
2919 (WTF::::ListHashSet):
2920 (WTF::::~ListHashSet):
2922 (WTF::::unlinkAndDelete):
2923 (WTF::::deleteAllNodes):
2925 2007-01-31 Maciej Stachowiak <mjs@apple.com>
2929 - fix sporadic crash
2931 * wtf/ListHashSet.h:
2932 (WTF::::remove): remove before deleting
2934 2007-01-31 Maciej Stachowiak <mjs@apple.com>
2936 Reviewed by Mark with help from Lars.
2938 - added new ListHashSet class, which combines a hashtable and a linked list to provide a set
2939 that keeps elements in inserted order
2941 This is to assist in fixing the following:
2942 <rdar://problem/4751164> REGRESSION: Safari places text on incorrect button when returning to a page via back [10541]
2943 http://bugs.webkit.org/show_bug.cgi?id=10541
2945 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2946 * JavaScriptCore.xcodeproj/project.pbxproj:
2948 (WTF::HashTable::find):
2949 (WTF::HashTable::contains):
2952 * wtf/ListHashSet.h: Added.
2953 (WTF::ListHashSetNode::ListHashSetNode):
2954 (WTF::ListHashSetNodeHashFunctions::hash):
2955 (WTF::ListHashSetNodeHashFunctions::equal):
2956 (WTF::ListHashSetIterator::ListHashSetIterator):
2957 (WTF::ListHashSetIterator::get):
2958 (WTF::ListHashSetIterator::operator*):
2959 (WTF::ListHashSetIterator::operator->):
2960 (WTF::ListHashSetIterator::operator++):
2961 (WTF::ListHashSetIterator::operator--):
2962 (WTF::ListHashSetIterator::operator==):
2963 (WTF::ListHashSetIterator::operator!=):
2964 (WTF::ListHashSetIterator::operator const_iterator):
2965 (WTF::ListHashSetIterator::node):
2966 (WTF::ListHashSetConstIterator::ListHashSetConstIterator):
2967 (WTF::ListHashSetConstIterator::get):
2968 (WTF::ListHashSetConstIterator::operator*):
2969 (WTF::ListHashSetConstIterator::operator->):
2970 (WTF::ListHashSetConstIterator::operator++):
2971 (WTF::ListHashSetConstIterator::operator--):
2972 (WTF::ListHashSetConstIterator::operator==):
2973 (WTF::ListHashSetConstIterator::operator!=):
2974 (WTF::ListHashSetConstIterator::node):
2975 (WTF::ListHashSetTranslator::hash):
2976 (WTF::ListHashSetTranslator::equal):
2977 (WTF::ListHashSetTranslator::translate):
2978 (WTF::::ListHashSet):
2980 (WTF::::~ListHashSet):
2991 (WTF::::unlinkAndDelete):
2992 (WTF::::appendNode):
2993 (WTF::::deleteAllNodes):
2994 (WTF::::makeIterator):
2995 (WTF::::makeConstIterator):
2996 (WTF::deleteAllValues):
2998 2007-01-30 Darin Adler <darin@apple.com>
3000 * kjs/DateMath.cpp: Fix license header to reflect LGPL as the first license
3001 mentioned. We still mention the option of using under MPL or GPL since some
3002 of this code came from the Mozilla project with those license terms.
3004 2007-01-30 Simon Hausmann <hausmann@kde.org>
3008 Turned JavaScriptCore from a separate library into an includable
3009 project, to combine it all into libWebKitQt.
3011 * JavaScriptCore.pri: Added.
3012 * JavaScriptCore.pro: Removed.
3015 2007-01-29 Geoffrey Garen <ggaren@apple.com>
3017 Reviewed by Maciej Stachowiak.
3019 Fixed <rdar://problem/4485644> REGRESSION: JavaScriptCore has init routines
3021 The TCMalloc module now initializes, if needed, inside GetCache() and
3022 fastMallocSetIsMultiThreaded(). We leverage the same synchronization
3023 technique used for enabling / disabling the single-threaded optimization
3024 to synchronize initialization of the library without requiring a lock
3027 1,251 runs of tcmalloc_unittest, 2 runs of a custom, massively multi-threaded
3028 tcmalloc_unittest, and my custom version of the PLT show no regressions.
3029 Super-accurate JS iBench reports a .24% regression, which is right at the
3030 limit of its error range, so I'm declaring victory.
3032 * wtf/FastMalloc.cpp:
3033 (WTF::fastMallocSetIsMultiThreaded): Initialize, if needed. (InitModule()
3034 checks the "if needed" part.)
3035 (WTF::TCMalloc_ThreadCache::GetCache): Restored original TCMalloc code
3036 inside #ifdef, for posterity. Added new initialization logic.
3037 (WTF::TCMalloc_ThreadCache::InitModule): Call InitTSD(), since we don't
3038 have a static initializer to call it for us, now. This means that fastMalloc
3039 is not usable as a general libc allocator, but it never was, and if it were
3040 the general libc allocator, we wouldn't be here in the first place, so whatever.
3041 (WTF::TCMalloc_ThreadCache::InitTSD): Don't try to take the pageheap_lock,
3042 since InitModule already has it.
3044 2007-01-29 Kevin McCullough <KMcCullough@apple.com>
3046 Reviewed by Geoff and Oliver.
3048 - rdar://problem/4955561
3049 - missusing JavaScript shouldn't crash webkit. Now it doesn't, in this case.
3051 * bindings/objc/objc_runtime.mm:
3052 (ObjcFallbackObjectImp::callAsFunction):
3053 * bindings/runtime_method.cpp:
3054 (RuntimeMethod::callAsFunction):
3055 * bindings/runtime_object.cpp:
3056 (RuntimeObjectImp::callAsFunction):
3058 2007-01-28 Geoffrey Garen <ggaren@apple.com>
3060 Reviewed by Maciej Stachowiak.
3062 First step in fixing <rdar://problem/4485644> REGRESSION: JavaScriptCore
3065 Don't rely on a static initializer to store the main thread's ID (which
3066 we would use to detect allocations on secondary threads). Instead, require
3067 the caller to notify fastMalloc if it might allocate on a secondary thread.
3069 Also fixed what seemed like a race condition in do_malloc.
3071 tcmalloc_unittest and my custom versions of JS iBench and PLT show no
3074 * wtf/FastMalloc.cpp:
3075 (WTF::fastMallocSetIsMultiThreaded):
3076 (1) Renamed from "fastMallocRegisterThread", which was a misleading name because
3077 not all threads need to register with fastMalloc -- only secondary threads
3078 need to, and only for the purpose of disabling its single-threaded optimization.
3080 (2) Use the pageheap_lock instead of a custom one, since we need to synchronize
3081 with the read of isMultiThreaded inside CreateCacheIfNecessary. This is a new
3082 requirement, now that we can't guarantee that the first call to CreateCacheIfNecessary
3083 will occur on the main thread at init time, before any other threads have been created.
3085 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3086 (WTF::do_malloc): Reverted WTF change only to call GetCache() if size <= kMaxSize.
3087 The WTF code would read phinited without holding the pageheap_lock, which
3088 seemed like a race condition. Regardless, calling GetCache reduces the number
3089 of code paths to module initialization, which will help in writing the
3090 final fix for this bug.
3092 2007-01-28 David Kilzer <ddkilzer@webkit.org>
3096 - fix http://bugs.webkit.org/show_bug.cgi?id=9815
3097 JavaScript TypeError loading Dean Edwards' JS compressor/obfuscator
3099 Creating a function using 'new Function()' was not setting its prototype with the
3100 same flags as 'function() { }'.
3102 Test: fast/js/function-prototype.html
3104 * kjs/function_object.cpp:
3105 (FunctionObjectImp::construct): Change flags from DontEnum|DontDelete|ReadOnly to
3106 Internal|DontDelete to match FuncDeclNode::processFuncDecl() and
3107 FuncExprNode::evaluate() in kjs/nodes.cpp.
3109 2007-01-27 Geoffrey Garen <ggaren@apple.com>
3111 Reviewed by Beth Dakin.
3113 Added some missing JSLocks, which might fix <rdar://problem/4889707>.
3115 We need to lock whenever we might allocate memory because our FastMalloc
3116 implementation requires clients to register their threads, which we do
3119 We also need to lock whenever modifying ref-counts because they're not
3122 * API/JSObjectRef.cpp:
3123 (JSClassCreate): Allocates memory
3124 (JSClassRetain): Modifies a ref-count
3125 (JSClassRelease): Modifies a ref-count
3126 (JSPropertyNameArrayRetain): Modifies a ref-count
3127 (JSPropertyNameArrayRelease): Modifies a ref-count
3128 * API/JSStringRef.cpp:
3129 (JSStringRetain): Modifies a ref-count
3130 * API/JSValueRef.cpp:
3131 (JSValueIsInstanceOfConstructor): Might allocate memory if an exception
3134 2007-01-27 Lars Knoll <lars@trolltech.com>
3138 * bindings/qt/qt_instance.h:
3140 2007-01-25 Geoffrey Garen <ggaren@apple.com>
3142 Reviewed by Maciej Stachowiak.
3144 Fixed <rdar://problem/4608404> WebScriptObject's _rootObject lack
3145 of ownership policy causes crashes (e.g., in Dashcode)
3147 The old model for RootObject ownership was either to (1) leak them or (2) assign
3148 them to a single owner -- the WebCore::Frame -- which would destroy them
3149 when it believed that all of its plug-ins had unloaded.
3151 This model was broken because of (1) and also because plug-ins are not the only
3152 RootObject clients. All Bindings clients are RootObjects clients, including
3153 applications, which outlive any particular WebCore::Frame.
3155 The new model for RootObject ownership is to reference-count them, with a
3156 throw-back to the old model: The WebCore::Frame tracks the RootObjects
3157 it creates, and invalidates them when it believes that all of its plug-ins
3160 We maintain this throw-back to avoid plug-in leaks, particularly from Java.
3161 Java is completely broken when it comes to releasing JavaScript objects.
3162 Comments in our code allege that Java does not always call finalize when
3163 collecting objects. Moreoever, my own testing reveals that, when Java does
3164 notify JavaScript of a finalize, the data it provides is totally bogus.
3166 This setup is far from ideal, but I don't think we can do better without
3167 completely rewriting the bindings code, and possibly part of the Java
3170 Layout tests pass. No additional leaks reported. WebCore/manual-tests/*liveconnect*
3171 and a few LiveConnect demos on the web also run without a hitch.
3173 const RootObject* => RootObject*, since we need to ref/deref
3175 * bindings/NP_jsobject.cpp:
3176 (jsDeallocate): deref our RootObjects. Also unprotect or JSObject, instead
3177 of just relying on the RootObject to do it for us when it's invalidated.
3178 (_isSafeScript): Check RootObject validity.
3179 (_NPN_CreateScriptObject): ditto
3180 (_NPN_Invoke): ditto
3181 (_NPN_Evaluate): ditto
3182 (_NPN_GetProperty): ditto
3183 (_NPN_SetProperty): ditto
3184 (_NPN_RemoveProperty): ditto
3185 (_NPN_HasProperty): ditto
3186 (_NPN_HasMethod): ditto
3187 (_NPN_SetException): ditto
3189 * bindings/runtime_root.cpp:
3190 Revived bit-rotted LIAR LIAR LIAR comment.
3192 LOOK: Added support for invalidating RootObjects without deleting them,
3193 which is the main goal of this patch.
3195 Moved protect counting into the RootObject class, to emphasize that
3196 the RootObject protects the JSObject, and unprotects it upon being invalidated.
3197 addNativeReference => RootObject::gcProtect
3198 removeNativeReference => RootObject::gcUnprotect
3199 ProtectCountSet::contains => RootObject::gcIsProtected
3201 I know we'll all be sad to see the word "native" go.
3203 * bindings/runtime_root.h: Added ref-counting support to RootObject, with
3204 all the standard accoutrements.
3206 * bindings/c/c_utility.cpp:
3207 (KJS::Bindings::convertValueToNPVariant): If we can't find a valid RootObject,
3208 return void instead of just leaking.
3210 * bindings/jni/jni_instance.cpp:
3211 (JavaInstance::JavaInstance): Don't take a RootObject in our constructor;
3212 be like other Instances and require the caller to call setRootObject. This
3213 reduces the number of ownership code paths.
3214 (JavaInstance::invokeMethod): Check RootObject for validity.
3215 * bindings/jni/jni_instance.h: Removed private no-arg constructor. Having
3216 an arg constructor accomplishes the same thing.
3218 * bindings/jni/jni_jsobject.cpp:
3219 (JavaJSObject::invoke): No need to call findProtectCountSet, because finalize()
3220 checks for RootObject validity.
3221 (JavaJSObject::JavaJSObject): check RootObject for validity
3222 (JavaJSObject::call): ditto
3223 (JavaJSObject::eval): ditto
3224 (JavaJSObject::getMember): ditto
3225 (JavaJSObject::setMember): ditto
3226 (JavaJSObject::removeMember): ditto
3227 (JavaJSObject::getSlot): ditto
3228 (JavaJSObject::setSlot): ditto
3229 (JavaJSObject::toString): ditto
3230 (JavaJSObject::finalize): ditto
3231 (JavaJSObject::createNative): No need to tell the RootObject to protect
3232 the global object, since the RootObject already owns the interpreter.
3234 * bindings/jni/jni_runtime.cpp:
3235 (JavaArray::JavaArray): Removed copy construcutor becaue it was unused.
3236 Dead code is dangerous code.
3238 * bindings/objc/objc_runtime.mm: Added WebUndefined protocol. Previous use
3239 of WebScriptObject was bogus, because WebUndefined is not a subclass of
3241 (convertValueToObjcObject): If we can't find a valid RootObject,
3242 return nil instead of just leaking.
3244 * bindings/objc/objc_utility.mm:
3245 (KJS::Bindings::convertValueToObjcValue): If we can't find a valid RootObject,
3246 return nil instead of just leaking.
3248 2007-01-27 Andrew Wellington <proton@wiretapped.net>
3252 Fix for Repeated string concatenation results in OOM crash
3253 http://bugs.webkit.org/show_bug.cgi?id=11131
3255 * kjs/operations.cpp:
3256 (KJS::add): Throw exception if string addition result is null
3258 (KJS::UString::UString): Don't call memcpy when malloc failed
3260 2007-01-25 Jan Kraemer <camel@gmx.de>
3264 Fix for http://bugs.webkit.org/show_bug.cgi?id=12382
3266 Fix crash on architectures with 32 bit ints and
3267 64 bit longs (For example Linux on AMD64)
3269 * kjs/dtoa.cpp: #define Long int as suggested in comment
3271 2007-01-24 Geoffrey Garen <ggaren@apple.com>
3273 Fixed up #include order for style. No review necessary.
3275 * API/JSStringRef.cpp:
3277 2007-01-24 Geoffrey Garen <ggaren@apple.com>
3279 Reviewed by Maciej Stachowiak.
3281 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3282 Copy JSStringRefCF, in case anybody wants to use it. (I just added
3285 2007-01-24 Maciej Stachowiak <mjs@apple.com>
3287 Not reviewed, trivial property change.
3289 * JavaScriptCore.vcproj/JavaScriptCore.sln: remove svn:mime-type
3290 property which made this binary.
3292 2007-01-25 Mark Rowe <mrowe@apple.com>
3296 * Info.plist: Update copyright string.
3298 2007-01-24 Darin Adler <darin@apple.com>
3300 Reviewed by Mark Rowe.
3302 * JavaScriptCore.xcodeproj/project.pbxproj: Changed to /usr/sbin/sysctl
3303 so we don't rely on people's paths.
3305 2007-01-23 Alice Liu <alice.liu@apple.com>
3309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3312 2007-01-23 Geoffrey Garen <ggaren@apple.com>
3316 * API/JSStringRef.h:
3317 * JavaScriptCore.xcodeproj/project.pbxproj:
3319 2007-01-24 Mark Rowe <mrowe@apple.com>
3321 Build fix for DumpRenderTree.
3323 * JavaScriptCore.xcodeproj/project.pbxproj: Make JSStringRefCF.h public so it's copied into built framework.
3325 2007-01-23 Anders Carlsson <acarlsson@apple.com>
3329 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3332 2007-01-23 Geoffrey Garen <ggaren@apple.com>
3334 Reviewed by Maciej Stachowiak.
3336 Fixed <rdar://problem/4885131> Move CFString function declarations from
3337 JSStringRef.h to JSStringRefCF.h
3339 Also removed remaining API FIXMEs and changed them into Radars.
3341 * API/JSClassRef.cpp:
3342 (OpaqueJSClass::OpaqueJSClass): Added Radar numbers for UTF8 conversion.
3344 * API/JSContextRef.cpp:
3345 (JSGlobalContextCreate): Replaced FIXME for NULL JSContextRef with Radar number.
3347 * API/JSObjectRef.h: Removed FIXME, which is unprofessional in a public header.
3349 * API/JSStringRef.cpp: Moved CF related implementations to JSStringRefCF.cpp.
3350 (JSStringCreateWithUTF8CString): Replaced FIXME with Radar number.
3351 * API/JSStringRef.h: Moved CF related declarations to JSStringRefCF.h. Added
3352 #include of JSStringRefCF.h as a stopgap until clients start #including
3353 it as needed by themselves.
3355 * API/JSStringRefCF.cpp: Added.
3356 (JSStringCreateWithCFString):
3357 (JSStringCopyCFString): Replaced JSChar cast with UniChar cast, which is
3358 more appropriate for a CF call.
3359 * API/JSStringRefCF.h: Added.
3360 * JavaScriptCore.xcodeproj/project.pbxproj:
3362 2007-01-18 Sanjay Madhav <sanjay12@gmail.com>
3366 Add JavaScriptCore define to help with tracing of when objects are marked.
3369 (KJS::JSObject::mark):
3371 2007-01-18 Simon Hausmann <hausmann@kde.org>
3375 * JavaScriptCore.pro: Remove generated files on make clean.
3378 2007-01-16 Alexey Proskuryakov <ap@webkit.org>
3382 http://bugs.webkit.org/show_bug.cgi?id=12268
3383 Give object prototypes their own names
3385 * kjs/lookup.h: Append "Prototype" to ClassName in KJS_IMPLEMENT_PROTOTYPE.
3387 2007-01-16 Geoffrey Garen <ggaren@apple.com>
3389 Reviewed by Darin Adler.
3391 Added re-entrency checking to GC allocation and collection. It is an error
3392 to allocate or collect from within a collection. We've had at least one
3393 case of each bug in the past.
3395 Added a comment to the API header, explaining that API clients must not
3396 make this mistake, either.
3398 Layout tests and JS tests pass.
3400 * API/JSObjectRef.h:
3401 * kjs/collector.cpp:
3402 (KJS::GCLock::GCLock):
3403 (KJS::GCLock::~GCLock):
3404 (KJS::Collector::allocate):
3405 (KJS::Collector::collect):
3407 2007-01-14 Mark Rowe <mrowe@apple.com>
3411 Minor fixes to JavaScript pretty-printing.
3413 * JavaScriptCore.exp:
3415 (KJS::Parser::prettyPrint): Return line number and error message if parsing fails.
3417 * kjs/nodes2string.cpp:
3418 (ElementNode::streamTo): Include comma delimiters in array literals.
3419 (PropertyNameNode::streamTo): Quote property names in object literals to handle the case when the property name is not a valid identifier.
3421 (doIt): Print any errors encountered while pretty-printing.
3423 2007-01-12 Anders Carlsson <acarlsson@apple.com>
3428 Add hash traits for unsigned long and unsigned long long.
3430 2007-01-12 Geoffrey Garen <ggaren@apple.com>
3434 Rolling back in r18786 with leaks fixed, and these renames slightly reworked:
3436 Because they can return 0:
3437 rootObjectForImp => findRootObject (overloaded for JSObject* and Interpreter*)
3438 rootObjectForInterpreter => findRootObject (ditto)
3439 findReferenceSet => findProtectCountSet
3441 2007-01-11 Geoffrey Garen <ggaren@apple.com>
3445 Rolling out r18786 because it caused leaks.
3447 2007-01-11 Geoffrey Garen <ggaren@apple.com>
3449 Reviewed by Anders Carlsson.
3451 Even more cleanup in preparation for fixing <rdar://problem/4608404>
3452 WebScriptObject's _executionContext lack of ownership policy causes
3453 crashes (e.g., in Dashcode)
3458 ReferencesSet | ProtectCounts => ProtectCountSet (because it's a typename for a set of GC protect counts)
3459 ReferencesByRootMap => RootObjectMap (because RootObjectToProtectCountSetMap would have been confusing)
3460 pv => protectedValues
3461 rootObjectForImp => getRootObject (overloaded for JSObject* and Interpreter*)
3462 rootObjectForInterpreter => getRootObject (ditto)
3463 findReferenceSet => getProtectCountSet
3466 (KJS::Bindings::getRootObjectMap): Changed to take advantage of built-in
3467 facility for initializing static variables.
3469 (KJS::Bindings::getProtectCountSet):
3470 (KJS::Bindings::destroyProtectCountSet): Added. Helps encapsulate the fact
3471 that getting a ProtectCountSet entails adding a RootObject to a hash table,
3472 and destroying one entails the reverse.
3474 (KJS::Bindings::getRootObject): Removed spurious NULL check.
3476 (KJS::Bindings::findReferenceSet): Renamed. Changed to use getRootObject()
3477 instead of iterating on its own.
3479 (KJS::Bindings::addNativeReference): Changed to use an early return instead
3480 of indenting the whole function.
3481 (KJS::Bindings::removeNativeReference): Ditto.
3483 2007-01-11 Geoffrey Garen <ggaren@apple.com>
3485 Reviewed by Anders Carlsson.
3487 Even more cleanup in preparation for fixing <rdar://problem/4608404>
3488 WebScriptObject's _executionContext lack of ownership policy causes
3489 crashes (e.g., in Dashcode)
3494 findRootObjectForNativeHandleFunction => createRootObject
3495 FindRootObjectForNativeHandleFunctionPtr => CreateRootObjectFunction
3497 Also removed unnecessary use of "Bindings::" prefix.
3499 * JavaScriptCore.exp:
3500 * bindings/jni/jni_jsobject.cpp:
3501 (JavaJSObject::createNative):
3502 (JavaJSObject::convertValueToJObject):
3503 (JavaJSObject::convertJObjectToValue):
3504 * bindings/runtime_root.cpp:
3505 (KJS::Bindings::RootObject::setCreateRootObject):
3506 * bindings/runtime_root.h:
3507 (KJS::Bindings::RootObject::createRootObject):
3509 2007-01-11 George Staikos <staikos@kde.org>
3513 Appears to be Mac specific right now.
3517 2007-01-10 Lars Knoll <lars@trolltech.com>