1 2008-08-29 Anders Carlsson <andersca@apple.com>
5 <rdar://problem/6174667>
6 When a machine is under heavy load, the Slow Script dialog often comes up many times and just gets in the way
8 Instead of using clock time, use the CPU time spent executing the current thread when
9 determining if the script has been running for too long.
13 (KJS::Machine::checkTimeout):
15 2008-08-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
17 Rubber-stamped by Sam Weinig.
19 Change 'term' to 'expr' in variable names to standardize terminology.
22 (KJS::BinaryOpNode::emitCode):
23 (KJS::ReverseBinaryOpNode::emitCode):
24 (KJS::ThrowableBinaryOpNode::emitCode):
26 (KJS::BinaryOpNode::BinaryOpNode):
27 (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
33 (KJS::LeftShiftNode::):
34 (KJS::RightShiftNode::):
35 (KJS::UnsignedRightShiftNode::):
39 (KJS::GreaterEqNode::):
40 (KJS::ThrowableBinaryOpNode::):
41 (KJS::InstanceOfNode::):
44 (KJS::NotEqualNode::):
45 (KJS::StrictEqualNode::):
46 (KJS::NotStrictEqualNode::):
50 * kjs/nodes2string.cpp:
51 (KJS::MultNode::streamTo):
52 (KJS::DivNode::streamTo):
53 (KJS::ModNode::streamTo):
54 (KJS::AddNode::streamTo):
55 (KJS::SubNode::streamTo):
56 (KJS::LeftShiftNode::streamTo):
57 (KJS::RightShiftNode::streamTo):
58 (KJS::UnsignedRightShiftNode::streamTo):
59 (KJS::LessNode::streamTo):
60 (KJS::GreaterNode::streamTo):
61 (KJS::LessEqNode::streamTo):
62 (KJS::GreaterEqNode::streamTo):
63 (KJS::InstanceOfNode::streamTo):
64 (KJS::InNode::streamTo):
65 (KJS::EqualNode::streamTo):
66 (KJS::NotEqualNode::streamTo):
67 (KJS::StrictEqualNode::streamTo):
68 (KJS::NotStrictEqualNode::streamTo):
69 (KJS::BitAndNode::streamTo):
70 (KJS::BitXOrNode::streamTo):
71 (KJS::BitOrNode::streamTo):
73 2008-08-28 Alp Toker <alp@nuanti.com>
75 GTK+ dist/build fix. List newly added header files.
79 2008-08-28 Sam Weinig <sam@webkit.org>
81 Reviewed by Oliver Hunt.
83 Change to throw a ReferenceError at runtime instead of a ParseError
84 at parse time, when the left hand side expression of a for-in statement
89 (KJS::ForInNode::emitCode):
91 2008-08-28 Alexey Proskuryakov <ap@webkit.org>
93 Not reviewed, build fix (at least for OpenBSD, posssibly more).
95 https://bugs.webkit.org/show_bug.cgi?id=20545
96 missing #include <unistd.h> in JavaScriptCore/VM/SamplingTool.cpp
98 * VM/SamplingTool.cpp: add the missing include.
100 2008-08-26 Kevin McCullough <kmccullough@apple.com>
102 Reviewed by Geoff and Cameron.
104 <rdar://problem/6174603> Hitting assertion in Register::codeBlock when
105 loading facebook (20516).
107 - This was a result of my line numbers change. After a host function is
108 called the stack does not get reset correctly.
109 - Oddly this also appears to be a slight speedup on SunSpider.
112 (KJS::Machine::privateExecute):
114 2008-08-26 Alexey Proskuryakov <ap@webkit.org>
116 Reviewed by Geoff and Tim.
118 Export new API methods.
120 * JavaScriptCore.exp:
122 2008-08-25 Kevin McCullough <kmccullough@apple.com>
124 Reviewed by Geoff, Tim and Mark.
126 <rdar://problem/6150623> JSProfiler: It would be nice if the profiles
127 in the console said what file and line number they came from
128 - Lay the foundation for getting line numbers and other data from the
129 JavaScript engine. With the cleanup in kjs/ExecState this is actually
130 a slight performance improvement.
132 * JavaScriptCore.exp: Export retrieveLastCaller() for WebCore.
133 * JavaScriptCore.xcodeproj/project.pbxproj:
134 * VM/Machine.cpp: Now Host and JS functions set a call frame on the
135 exec state, so this and the profiler code were pulled out of the
137 (KJS::Machine::privateExecute):
138 (KJS::Machine::retrieveLastCaller): This get's the lineNumber, sourceID
139 and sourceURL for the previously called function.
141 * kjs/ExecState.cpp: Remove references to JSFunction since it's not used
145 2008-08-25 Alexey Proskuryakov <ap@webkit.org>
149 Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other
150 contexts in the current context's group.
152 This is only really necessary when the last reference is released, but there is no way to
153 determine that, and no harm in collecting slightly more often.
155 * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not
158 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
160 Reviewed by Oliver Hunt.
162 Bug 20093: JSC shell does not clear exceptions after it executes toString on an expression
163 <https://bugs.webkit.org/show_bug.cgi?id=20093>
165 Clear exceptions after evaluating any code in the JSC shell. We do not
166 report exceptions that are caused by calling toString on the final
167 valued, but at least we avoid incorrect behaviour.
169 Also, print any exceptions that occurred while evaluating code at the
170 interactive prompt, not just while evaluating code from a file.
176 2008-08-24 Mark Rowe <mrowe@apple.com>
178 Reviewed by Oliver Hunt.
180 Use the correct version number for when JSGlobalContextCreate was introduced.
182 * API/JSContextRef.h:
184 2008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
186 Rubber-stamped by Mark Rowe.
192 * API/JSCallbackConstructor.cpp:
193 * API/JSCallbackConstructor.h:
194 * API/JSCallbackFunction.cpp:
195 * API/JSCallbackFunction.h:
196 * API/JSCallbackObject.cpp:
197 * API/JSCallbackObject.h:
198 * API/JSCallbackObjectFunctions.h:
199 * API/JSClassRef.cpp:
200 * API/JSContextRef.cpp:
201 * API/JSObjectRef.cpp:
202 * API/JSProfilerPrivate.cpp:
203 * API/JSStringRef.cpp:
204 * API/JSStringRefBSTR.cpp:
205 * API/JSStringRefCF.cpp:
206 * API/JSValueRef.cpp:
207 * API/tests/JSNode.c:
208 * API/tests/JSNode.h:
209 * API/tests/JSNodeList.c:
210 * API/tests/JSNodeList.h:
213 * API/tests/NodeList.c:
214 * API/tests/NodeList.h:
215 * API/tests/minidom.c:
216 * API/tests/minidom.js:
217 * API/tests/testapi.c:
218 * API/tests/testapi.js:
219 * JavaScriptCore.pro:
220 * kjs/FunctionConstructor.h:
221 * kjs/FunctionPrototype.h:
224 * kjs/JSWrapperObject.cpp:
225 * kjs/NumberConstructor.h:
226 * kjs/NumberObject.h:
227 * kjs/NumberPrototype.h:
230 * wtf/Assertions.cpp:
232 * wtf/HashCountedSet.h:
233 * wtf/HashFunctions.h:
234 * wtf/HashIterators.h:
247 * wtf/RefPtrHashMap.h:
251 * wtf/VectorTraits.h:
252 * wtf/unicode/Unicode.h:
253 * wtf/unicode/icu/UnicodeIcu.h:
255 2008-08-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
259 Some cleanup to match our coding style.
261 * VM/CodeGenerator.h:
263 (KJS::Machine::privateExecute):
267 * kjs/identifier.cpp:
268 (KJS::Identifier::equal):
269 (KJS::CStringTranslator::hash):
270 (KJS::CStringTranslator::equal):
271 (KJS::CStringTranslator::translate):
272 (KJS::UCharBufferTranslator::equal):
273 (KJS::UCharBufferTranslator::translate):
274 (KJS::Identifier::remove):
277 2008-08-20 Alexey Proskuryakov <ap@webkit.org>
281 * API/WebKitAvailability.h: Define DEPRECATED_ATTRIBUTE.
283 2008-08-19 Alexey Proskuryakov <ap@webkit.org>
285 Reviewed by Geoff Garen.
287 Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
289 * kjs/JSGlobalData.cpp:
290 (KJS::JSGlobalData::~JSGlobalData):
291 (KJS::JSGlobalData::JSGlobalData): Re-add shared instance.
292 (KJS::JSGlobalData::sharedInstanceExists): Ditto.
293 (KJS::JSGlobalData::sharedInstance): Ditto.
294 (KJS::JSGlobalData::sharedInstanceInternal): Ditto.
296 * API/JSContextRef.h: Deprecated JSGlobalContextCreate(). Added a very conservative
297 description of its threading model (nothing is allowed).
299 * API/JSContextRef.cpp:
300 (JSGlobalContextCreate): Use shared JSGlobalData.
301 (JSGlobalContextCreateInGroup): Support passing NULL group to request a unique one.
302 (JSGlobalContextRetain): Added back locking.
303 (JSGlobalContextRelease): Ditto.
304 (JSContextGetGlobalObject): Ditto.
306 * API/tests/minidom.c: (main):
307 * API/tests/testapi.c: (main):
308 Switched to JSGlobalContextCreateInGroup() to avoid deprecation warnings.
310 * JavaScriptCore.exp: Re-added JSLock methods. Added JSGlobalContextCreateInGroup (d'oh!).
314 (JSCheckScriptSyntax):
316 * API/JSCallbackConstructor.cpp:
317 (KJS::constructJSCallback):
318 * API/JSCallbackFunction.cpp:
319 (KJS::JSCallbackFunction::call):
320 * API/JSCallbackObjectFunctions.h:
322 (KJS::::getOwnPropertySlot):
324 (KJS::::deleteProperty):
326 (KJS::::hasInstance):
328 (KJS::::getPropertyNames):
331 (KJS::::staticValueGetter):
332 (KJS::::callbackGetter):
333 * API/JSObjectRef.cpp:
335 (JSObjectMakeFunctionWithCallback):
336 (JSObjectMakeConstructor):
337 (JSObjectMakeFunction):
338 (JSObjectHasProperty):
339 (JSObjectGetProperty):
340 (JSObjectSetProperty):
341 (JSObjectGetPropertyAtIndex):
342 (JSObjectSetPropertyAtIndex):
343 (JSObjectDeleteProperty):
344 (JSObjectCallAsFunction):
345 (JSObjectCallAsConstructor):
346 (JSObjectCopyPropertyNames):
347 (JSPropertyNameArrayRelease):
348 (JSPropertyNameAccumulatorAddName):
349 * API/JSValueRef.cpp:
351 (JSValueIsInstanceOfConstructor):
355 (JSValueToStringCopy):
359 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
361 * JavaScriptCore.pri:
362 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
363 * JavaScriptCore.xcodeproj/project.pbxproj:
364 * JavaScriptCoreSources.bkl:
365 * kjs/AllInOneFile.cpp:
366 * kjs/JSGlobalData.h:
367 * kjs/JSGlobalObject.cpp:
368 (KJS::JSGlobalObject::~JSGlobalObject):
369 (KJS::JSGlobalObject::init):
370 * kjs/JSLock.cpp: Added.
371 (KJS::createJSLockCount):
372 (KJS::JSLock::lockCount):
374 (KJS::JSLock::JSLock):
376 (KJS::JSLock::unlock):
377 (KJS::JSLock::currentThreadIsHoldingLock):
378 (KJS::JSLock::DropAllLocks::DropAllLocks):
379 (KJS::JSLock::DropAllLocks::~DropAllLocks):
380 * kjs/JSLock.h: Added.
381 (KJS::JSLock::JSLock):
382 (KJS::JSLock::~JSLock):
388 (KJS::Heap::heapAllocate):
389 (KJS::Heap::setGCProtectNeedsLocking):
390 (KJS::Heap::protect):
391 (KJS::Heap::unprotect):
392 (KJS::Heap::collect):
393 * kjs/identifier.cpp:
394 * kjs/interpreter.cpp:
395 (KJS::Interpreter::checkSyntax):
396 (KJS::Interpreter::evaluate):
397 Re-added implicit locking.
399 2008-08-19 Kevin McCullough <kmccullough@apple.com>
401 Reviewed by Tim and Mark.
403 Implement DTrace hooks for dashcode and instruments.
405 * API/JSProfilerPrivate.cpp: Added. Expose SPI so that profiling can be
406 turned on from a client. The DTrace probes were added within the
407 profiler mechanism for performance reasons so the profiler must be
408 started to enable tracing.
411 * API/JSProfilerPrivate.h: Added. Ditto.
412 * JavaScriptCore.exp: Exposing the start/stop methods to clients.
413 * JavaScriptCore.xcodeproj/project.pbxproj:
414 * kjs/Tracing.d: Define the DTrace probes.
415 * kjs/Tracing.h: Ditto.
416 * profiler/ProfileGenerator.cpp: Implement the DTrace probes in the
418 (KJS::ProfileGenerator::willExecute):
419 (KJS::ProfileGenerator::didExecute):
421 2008-08-19 Steve Falkenburg <sfalken@apple.com>
425 * kjs/operations.cpp:
428 2008-08-18 Timothy Hatcher <timothy@apple.com>
430 Fix an assertion when generating a heavy profile because the
431 empty value and deleted value of CallIdentifier where equal.
433 https://bugs.webkit.org/show_bug.cgi?id=20439
435 Reviewed by Dan Bernstein.
437 * profiler/CallIdentifier.h: Make the emptyValue for CallIdentifier
438 use empty strings for URL and function name.
440 2008-08-12 Darin Adler <darin@apple.com>
444 - eliminate JSValue::type()
446 This will make it slightly easier to change the JSImmediate design without
447 having to touch so many call sites.
449 SunSpider says this change is a wash (looked like a slight speedup, but not
450 statistically significant).
452 * API/JSStringRef.cpp: Removed include of JSType.h.
453 * API/JSValueRef.cpp: Removed include of JSType.h.
454 (JSValueGetType): Replaced use of JSValue::type() with
455 JSValue::is functions.
457 * JavaScriptCore.exp: Updated.
459 * VM/JSPropertyNameIterator.cpp: Removed type() implementation.
460 (KJS::JSPropertyNameIterator::toPrimitive): Changed to take
461 PreferredPrimitiveType argument instead of JSType.
462 * VM/JSPropertyNameIterator.h: Ditto.
465 (KJS::fastIsNumber): Updated for name change.
466 (KJS::fastToInt32): Ditto.
467 (KJS::fastToUInt32): Ditto.
468 (KJS::jsAddSlowCase): Updated toPrimitive caller for change from
469 JSType to PreferredPrimitiveType.
470 (KJS::jsAdd): Replaced calls to JSValue::type() with calls to
472 (KJS::jsTypeStringForValue): Replaced calls to JSValue::type()
473 with multiple calls to JSValue::is -- we could make this a
474 virtual function instead if we want to have faster performance.
475 (KJS::Machine::privateExecute): Renamed JSImmediate::toTruncatedUInt32
476 to JSImmediate::getTruncatedUInt32 for consistency with other functions.
477 Changed two calls of JSValue::type() to JSValue::isString().
479 * kjs/GetterSetter.cpp:
480 (KJS::GetterSetter::toPrimitive): Changed to take
481 PreferredPrimitiveType argument instead of JSType.
482 (KJS::GetterSetter::isGetterSetter): Added.
483 * kjs/GetterSetter.h:
486 (KJS::JSCell::isString): Added.
487 (KJS::JSCell::isGetterSetter): Added.
488 (KJS::JSCell::isObject): Added.
490 * kjs/JSCell.h: Eliminated type function. Added isGetterSetter.
491 Made isString and isObject virtual. Changed toPrimitive to take
492 PreferredPrimitiveType argument instead of JSType.
493 (KJS::JSCell::isNumber): Use Heap::isNumber for faster performance.
494 (KJS::JSValue::isGetterSetter): Added.
495 (KJS::JSValue::toPrimitive): Changed to take
496 PreferredPrimitiveType argument instead of JSType.
498 * kjs/JSImmediate.h: Removed JSValue::type() and replaced
499 JSValue::toTruncatedUInt32 with JSValue::getTruncatedUInt32.
500 (KJS::JSImmediate::isEitherImmediate): Added.
502 * kjs/JSNotAnObject.cpp:
503 (KJS::JSNotAnObject::toPrimitive): Changed to take
504 PreferredPrimitiveType argument instead of JSType.
505 * kjs/JSNotAnObject.h: Ditto.
506 * kjs/JSNumberCell.cpp:
507 (KJS::JSNumberCell::toPrimitive): Ditto.
508 * kjs/JSNumberCell.h:
509 (KJS::JSNumberCell::toInt32): Renamed from fastToInt32. There's no
510 other "slow" version of this once you have a JSNumberCell, so there's
511 no need for "fast" in the name. It's a feature that this hides the
512 base class toInt32, which does the same job less efficiently (and has
513 an additional ExecState argument).
514 (KJS::JSNumberCell::toUInt32): Ditto.
517 (KJS::callDefaultValueFunction): Use isGetterSetter instead of type.
518 (KJS::JSObject::getPrimitiveNumber): Use PreferredPrimitiveType.
519 (KJS::JSObject::defaultValue): Ditto.
520 (KJS::JSObject::defineGetter): Use isGetterSetter.
521 (KJS::JSObject::defineSetter): Ditto.
522 (KJS::JSObject::lookupGetter): Ditto.
523 (KJS::JSObject::lookupSetter): Ditto.
524 (KJS::JSObject::toNumber): Use PreferredPrimitiveType.
525 (KJS::JSObject::toString): Ditto.
526 (KJS::JSObject::isObject): Added.
529 (KJS::JSObject::inherits): Call the isObject from JSCell; it's now
530 hidden by our override of isObject.
531 (KJS::JSObject::getOwnPropertySlotForWrite): Use isGetterSetter
533 (KJS::JSObject::getOwnPropertySlot): Ditto.
534 (KJS::JSObject::toPrimitive): Use PreferredPrimitiveType.
537 (KJS::JSString::toPrimitive): Use PreferredPrimitiveType.
538 (KJS::JSString::isString): Added.
539 * kjs/JSString.h: Ditto.
541 * kjs/JSValue.h: Removed type(), added isGetterSetter(). Added
542 PreferredPrimitiveType enum and used it as the argument for the
543 toPrimitive function.
544 (KJS::JSValue::getBoolean): Simplified a bit an removed a branch.
547 (KJS::typeName): Changed to use JSCell::is functions instead of
548 calling JSCell::type.
551 (KJS::Heap::isNumber): Renamed from fastIsNumber.
553 * kjs/nodes.h: Added now-needed include of JSType, since the type
554 is used here to record types of values in the tree.
556 * kjs/operations.cpp:
557 (KJS::equal): Rewrote to no longer depend on type().
558 (KJS::strictEqual): Ditto.
560 2008-08-18 Kevin McCullough <kmccullough@apple.com>
564 If there are no nodes in a profile all the time should be attributed to
567 * profiler/Profile.cpp: If ther are no nodes make sure we still process
569 (KJS::Profile::forEach):
570 * profiler/ProfileGenerator.cpp: Remove some useless code.
571 (KJS::ProfileGenerator::stopProfiling):
573 2008-08-18 Alexey Proskuryakov <ap@webkit.org>
577 Make JSGlobalContextRetain/Release actually work.
579 * API/JSContextRef.cpp:
580 (JSGlobalContextRetain):
581 (JSGlobalContextRelease):
582 Ref/deref global data to give checking for globalData.refCount() some sense.
584 * API/tests/testapi.c: (main): Added a test for this bug.
586 * kjs/JSGlobalData.cpp:
587 (KJS::JSGlobalData::~JSGlobalData):
588 While checking for memory leaks, found that JSGlobalData::emptyList has changed to
589 a pointer, but it was not destructed, causing a huge leak in run-webkit-tests --threaded.
591 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
595 Change the counting of constants so that preincrement and predecrement of
596 const local variables are considered unexpected loads.
599 (KJS::PrefixResolveNode::emitCode):
601 (KJS::ScopeNode::neededConstants):
603 2008-08-17 Oliver Hunt <oliver@apple.com>
605 Reviewed by Cameron Zwarich.
607 <rdar://problem/6150322> In Gmail, a crash occurs at KJS::Machine::privateExecute() when applying list styling to text after a quote had been removed
608 <https://bugs.webkit.org/show_bug.cgi?id=20386>
610 This crash was caused by "depth()" incorrectly determining the scope depth
611 of a 0 depth function without a full scope chain. Because such a function
612 would not have an activation the depth function would return the scope depth
613 of the parent frame, thus triggering an incorrect unwind. Any subsequent
614 look up that walked the scope chain would result in incorrect behaviour,
615 leading to a crash or incorrect variable resolution. This can only actually
616 happen in try...finally statements as that's the only path that can result in
617 the need to unwind the scope chain, but not force the function to need a
620 The fix is simply to check for this case before attempting to walk the scope chain.
624 (KJS::Machine::throwException):
626 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
630 Bug 20419: Remove op_jless
631 <https://bugs.webkit.org/show_bug.cgi?id=20419>
633 Remove op_jless, which is rarely used now that we have op_loop_if_less.
636 (KJS::CodeBlock::dump):
637 * VM/CodeGenerator.cpp:
638 (KJS::CodeGenerator::emitJumpIfTrue):
640 (KJS::Machine::privateExecute):
643 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
645 Reviewed by Dan Bernstein.
647 Fix a typo in r35807 that is also causing build failures for
650 * kjs/NumberConstructor.cpp:
652 2008-08-17 Geoffrey Garen <ggaren@apple.com>
654 Reviewed by Cameron Zwarich.
656 Made room for a free word in JSCell.
658 SunSpider says no change.
660 I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
661 store auxiliary data in a secondary structure.
663 I changed InternalFunction to store the function's name in the property
666 I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
667 JSDOMWindowBaseData could inherit from it safely. (It's a strange design
668 for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
669 but that's really our only option, given the size constraint.)
671 I also added a bunch of compile-time ASSERTs, and removed lots of comments
672 in JSObject.h because they were often out of date, and they got in the
673 way of reading what was actually going on.
675 Also renamed JSArray::getLength to JSArray::length, to match our style
678 2008-08-16 Geoffrey Garen <ggaren@apple.com>
680 Reviewed by Oliver Hunt.
682 Sped up property access for array.length and string.length by adding a
683 mechanism for returning a temporary value directly instead of returning
684 a pointer to a function that retrieves the value.
686 Also removed some unused cruft from PropertySlot.
688 SunSpider says 0.5% - 1.2% faster.
690 NOTE: This optimization is not a good idea in general, because it's
691 actually a pessimization in the case of resolve for assignment,
692 and it may get in the way of other optimizations in the future.
694 2008-08-16 Dan Bernstein <mitz@apple.com>
696 Reviewed by Geoffrey Garen.
698 Disable dead code stripping in debug builds.
700 * Configurations/Base.xcconfig:
701 * JavaScriptCore.xcodeproj/project.pbxproj:
703 2008-08-15 Mark Rowe <mrowe@apple.com>
705 Reviewed by Oliver Hunt.
707 <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap
709 * wtf/FastMalloc.cpp:
710 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with
711 a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that.
712 (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can
713 be used when calculating local addresses.
714 (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto.
716 2008-08-15 Mark Rowe <mrowe@apple.com>
718 Rubber-stamped by Geoff Garen.
720 <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework
722 * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared
723 between the Debug configuration and debug Production variant.
724 * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant.
726 2008-08-15 Mark Rowe <mrowe@apple.com>
728 Fix the 64-bit build.
730 Add extra cast to avoid warnings about loss of precision when casting from
731 JSValue* to an integer type.
734 (KJS::JSImmediate::intValue):
735 (KJS::JSImmediate::uintValue):
737 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
739 Still fixing Windows build.
741 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString
742 to yet another place.
744 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
746 Trying to fix non-Apple builds.
748 * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added.
750 2008-08-15 Gavin Barraclough <barraclough@apple.com>
752 Reviewed by Geoff Garen.
754 Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a
755 JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a
756 JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer,
757 but instead holds an immediate value encoded within the pointer. This patch changes the
758 encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing
759 a 31 bit value to be stored. All other immediates are tagged with the value 10, and
760 distinguished by a secondary tag.
762 Roughly +2% on SunSpider.
764 * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for
765 descption of new layout.
767 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
771 * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC.
772 * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly.
773 * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build.
775 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
779 * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private
781 * kjs/identifier.cpp:
782 (KJS::Identifier::checkSameIdentifierTable):
784 (KJS::Identifier::add):
785 Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be
786 non-inline in release builds, too.
788 * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor.
790 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
792 Reviewed by Geoff Garen.
794 JSStringRef is created context-free, but can get linked to one via an identifier table,
795 breaking an implicit API contract.
797 Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.
799 * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a
802 * kjs/identifier.cpp:
803 (KJS::Identifier::checkSameIdentifierTable):
805 (KJS::Identifier::add):
806 (KJS::UString::checkSameIdentifierTable):
807 Added assertions to verify that an identifier is not being added to a different JSGlobalData.
809 * API/JSObjectRef.cpp:
810 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to
811 hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance
812 in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast.
814 * API/OpaqueJSString.cpp: Added.
815 (OpaqueJSString::create):
816 (OpaqueJSString::ustring):
817 (OpaqueJSString::identifier):
818 * API/OpaqueJSString.h: Added.
819 (OpaqueJSString::create):
820 (OpaqueJSString::characters):
821 (OpaqueJSString::length):
822 (OpaqueJSString::OpaqueJSString):
823 (OpaqueJSString::~OpaqueJSString):
827 (JSCheckScriptSyntax):
828 * API/JSCallbackObjectFunctions.h:
829 (KJS::::getOwnPropertySlot):
831 (KJS::::deleteProperty):
832 (KJS::::staticValueGetter):
833 (KJS::::callbackGetter):
834 * API/JSStringRef.cpp:
835 (JSStringCreateWithCharacters):
836 (JSStringCreateWithUTF8CString):
840 (JSStringGetCharactersPtr):
841 (JSStringGetMaximumUTF8CStringSize):
842 (JSStringGetUTF8CString):
844 * API/JSStringRefCF.cpp:
845 (JSStringCreateWithCFString):
846 (JSStringCopyCFString):
847 * API/JSValueRef.cpp:
849 (JSValueToStringCopy):
850 Updated to use OpaqueJSString.
853 * JavaScriptCore.exp:
854 * JavaScriptCore.pri:
855 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
856 * JavaScriptCore.xcodeproj/project.pbxproj:
857 * JavaScriptCoreSources.bkl:
858 Added OpaqueJSString.
860 2008-08-14 Kevin McCullough <kmccullough@apple.com>
864 <rdar://problem/6115819> Notify of profile in console
865 - Profiles now have a unique ID so that they can be linked to the
866 console message that announces that a profile completed.
868 * profiler/HeavyProfile.cpp:
869 (KJS::HeavyProfile::HeavyProfile):
870 * profiler/Profile.cpp:
871 (KJS::Profile::create):
872 (KJS::Profile::Profile):
873 * profiler/Profile.h:
875 * profiler/ProfileGenerator.cpp:
876 (KJS::ProfileGenerator::create):
877 (KJS::ProfileGenerator::ProfileGenerator):
878 * profiler/ProfileGenerator.h:
879 * profiler/Profiler.cpp:
880 (KJS::Profiler::startProfiling):
881 * profiler/TreeProfile.cpp:
882 (KJS::TreeProfile::create):
883 (KJS::TreeProfile::TreeProfile):
884 * profiler/TreeProfile.h:
886 2008-08-13 Geoffrey Garen <ggaren@apple.com>
888 Reviewed by Oliver Hunt.
890 Nixed a PIC branch from JSObject::getOwnPropertySlot, by forcing
891 fillGetterProperty, which references a global function pointer,
894 .2% SunSpider speedup, 4.3% access-nbody speedup, 8.7% speedup on a
895 custom property access benchmark for objects with one property.
898 (KJS::JSObject::fillGetterPropertySlot):
900 2008-08-13 Alp Toker <alp@nuanti.com>
902 Reviewed by Eric Seidel.
904 https://bugs.webkit.org/show_bug.cgi?id=20349
905 WTF::initializeThreading() fails if threading is already initialized
907 Fix threading initialization logic to support cases where
908 g_thread_init() has already been called elsewhere.
910 Resolves database-related crashers reported in several applications.
912 * wtf/ThreadingGtk.cpp:
913 (WTF::initializeThreading):
915 2008-08-13 Brad Hughes <bhughes@trolltech.com>
919 Fix compiling of QtWebKit in release mode with the Intel C++ Compiler for Linux
921 The latest upgrade of the intel compiler allows us to compile all of
922 Qt with optimizations enabled (yay!).
924 * JavaScriptCore.pro:
926 2008-08-12 Oliver Hunt <oliver@apple.com>
928 Reviewed by Geoff Garen.
930 Add peephole optimisation to 'op_not... jfalse...' (eg. if(!...) )
932 This is a very slight win in sunspider, and a fairly substantial win
933 in hot code that does if(!...), etc.
935 * VM/CodeGenerator.cpp:
936 (KJS::CodeGenerator::retrieveLastUnaryOp):
937 (KJS::CodeGenerator::rewindBinaryOp):
938 (KJS::CodeGenerator::rewindUnaryOp):
939 (KJS::CodeGenerator::emitJumpIfFalse):
940 * VM/CodeGenerator.h:
942 2008-08-12 Dan Bernstein <mitz@apple.com>
944 - JavaScriptCore part of <rdar://problem/6121636>
945 Make fast*alloc() abort() on failure and add "try" variants that
946 return NULL on failure.
948 Reviewed by Darin Adler.
950 * JavaScriptCore.exp: Exported tryFastCalloc().
952 (KJS::RegisterFile::RegisterFile): Removed an ASSERT().
954 (KJS::JSArray::putSlowCase): Changed to use tryFastRealloc().
955 (KJS::JSArray::increaseVectorLength): Ditto.
957 (KJS::allocChars): Changed to use tryFastMalloc().
958 (KJS::reallocChars): Changed to use tryFastRealloc().
959 * wtf/FastMalloc.cpp:
960 (WTF::fastZeroedMalloc): Removed null checking of fastMalloc()'s result
961 and removed extra call to InvokeNewHook().
962 (WTF::tryFastZeroedMalloc): Added. Uses tryFastMalloc().
963 (WTF::tryFastMalloc): Renamed fastMalloc() to this.
964 (WTF::fastMalloc): Added. This version abort()s if allocation fails.
965 (WTF::tryFastCalloc): Renamed fastCalloc() to this.
966 (WTF::fastCalloc): Added. This version abort()s if allocation fails.
967 (WTF::tryFastRealloc): Renamed fastRealloc() to this.
968 (WTF::fastRealloc): Added. This version abort()s if allocation fails.
969 (WTF::do_malloc): Made this a function template. When the abortOnFailure
970 template parameter is set, the function abort()s on failure to allocate.
971 Otherwise, it sets errno to ENOMEM and returns zero.
972 (WTF::TCMallocStats::fastMalloc): Defined to abort() on failure.
973 (WTF::TCMallocStats::tryFastMalloc): Added. Does not abort() on
975 (WTF::TCMallocStats::fastCalloc): Defined to abort() on failure.
976 (WTF::TCMallocStats::tryFastCalloc): Added. Does not abort() on
978 (WTF::TCMallocStats::fastRealloc): Defined to abort() on failure.
979 (WTF::TCMallocStats::tryFastRealloc): Added. Does not abort() on
981 * wtf/FastMalloc.h: Declared the "try" variants.
983 2008-08-11 Adam Roben <aroben@apple.com>
985 Move WTF::notFound into its own header so that it can be used
986 independently of Vector
988 Rubberstamped by Darin Adler.
990 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
991 * JavaScriptCore.xcodeproj/project.pbxproj:
992 Added NotFound.h to the project.
993 * wtf/NotFound.h: Added. Moved the notFound constant here...
994 * wtf/Vector.h: ...from here.
996 2008-08-11 Alexey Proskuryakov <ap@webkit.org>
998 Reviewed by Mark Rowe.
1000 <rdar://problem/6130393> REGRESSION: PhotoBooth hangs after launching under TOT Webkit
1002 * API/JSContextRef.cpp: (JSGlobalContextRelease): Corrected a comment.
1004 * kjs/collector.cpp: (KJS::Heap::~Heap): Ensure that JSGlobalData is not deleted while
1007 == Rolled over to ChangeLog-2008-08-10 ==