1 2008-05-13 Kevin McCullough <kmccullough@apple.com>
5 <rdar://problem/5770054> JavaScript profiler (10928)
6 - Made some functions static (as per Adam) and changed from using raw
7 pointers to RefPtr for making these JavaScript Objects.
9 * profiler/FunctionCallProfile.cpp:
10 (KJS::FunctionCallProfile::addChild):
11 (KJS::FunctionCallProfile::findChild):
12 * profiler/FunctionCallProfile.h:
13 (KJS::FunctionCallProfile::create):
14 * profiler/Profile.cpp:
15 (KJS::Profile::Profile):
16 (KJS::Profile::willExecute):
17 (KJS::Profile::didExecute):
18 (KJS::functionNameCountPairComparator):
20 (KJS::Profile::create):
21 (KJS::Profile::title):
22 (KJS::Profile::callTree):
23 * profiler/Profiler.cpp:
24 (KJS::Profiler::startProfiling):
25 * profiler/Profiler.h:
26 (KJS::Profiler::allProfiles):
27 (KJS::Profiler::clearProfiles):
29 2008-05-13 Alexey Proskuryakov <ap@webkit.org>
31 Reviewed by Geoffrey Garen.
33 <rdar://problem/4949018> JavaScriptCore API claims to work with UTF8 strings, but only works
38 (KJS::UString::Rep::createFromUTF8):
39 Added. Implementation adapted from JSStringCreateWithUTF8CString().
41 * API/JSStringRef.cpp:
42 (JSStringCreateWithUTF8CString):
44 (OpaqueJSClass::OpaqueJSClass):
45 Use UString::Rep::createFromUTF8().
47 2008-05-12 Mark Rowe <mrowe@apple.com>
49 Reviewed by Tim Hatcher.
51 <rdar://problem/4859666> WebKit needs availability macros in order to deprecate APIs
53 Create WebKit availability macros that key off the Mac OS X version being targeted to
54 determine the WebKit version being targeted. Applications can define
55 WEBKIT_VERSION_MIN_REQUIRED before including WebKit headers in order to target a specific
58 The availability header is being added to JavaScriptCore rather than WebKit as JavaScriptCore
59 is the lowest-level portion of the public WebKit API.
61 * API/WebKitAvailability.h: Added.
62 * JavaScriptCore.xcodeproj/project.pbxproj:
64 2008-05-12 Alexey Proskuryakov <ap@webkit.org>
68 https://bugs.webkit.org/show_bug.cgi?id=18828
69 Reproducible crash with PAC file
71 Naively moving JavaScriptCore into thread-specific data was inappropriate in the face of
72 exiting JavaScriptCore API clients, which expect a different therading model. Temporarily
73 disabling ThreadSpecific implementation until this can be sorted out.
75 * wtf/ThreadSpecific.h:
76 (WTF::::ThreadSpecific):
77 (WTF::::~ThreadSpecific):
81 2008-05-12 Alexey Proskuryakov <ap@webkit.org>
83 Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
88 * API/JSCallbackObjectFunctions.h:
89 (KJS::::staticFunctionGetter):
91 (OpaqueJSClass::prototype):
92 * API/JSObjectRef.cpp:
94 (JSObjectMakeFunctionWithCallback):
95 (JSObjectMakeConstructor):
96 (JSObjectMakeFunction):
100 * JavaScriptCore.exp:
102 * kjs/InitializeThreading.cpp:
103 (KJS::initializeThreadingOnce):
104 * kjs/JSGlobalObject.cpp:
105 (KJS::JSGlobalObject::~JSGlobalObject):
106 (KJS::JSGlobalObject::init):
107 (KJS::JSGlobalObject::put):
108 (KJS::JSGlobalObject::reset):
109 (KJS::JSGlobalObject::tearOffActivation):
110 * kjs/JSGlobalObject.h:
111 (KJS::JSGlobalObject::head):
112 (KJS::JSGlobalObject::perThreadData):
114 (KJS::JSLock::registerThread):
116 (KJS::JSLock::JSLock):
117 * kjs/array_instance.cpp:
118 (KJS::ArrayInstance::ArrayInstance):
119 (KJS::ArrayInstance::lengthGetter):
120 * kjs/array_object.cpp:
121 (KJS::arrayProtoFuncToString):
122 (KJS::arrayProtoFuncToLocaleString):
123 (KJS::arrayProtoFuncJoin):
124 (KJS::arrayProtoFuncConcat):
125 (KJS::arrayProtoFuncPop):
126 (KJS::arrayProtoFuncPush):
127 (KJS::arrayProtoFuncShift):
128 (KJS::arrayProtoFuncSlice):
129 (KJS::arrayProtoFuncSplice):
130 (KJS::arrayProtoFuncUnShift):
131 (KJS::arrayProtoFuncFilter):
132 (KJS::arrayProtoFuncMap):
133 (KJS::arrayProtoFuncEvery):
134 (KJS::arrayProtoFuncForEach):
135 (KJS::arrayProtoFuncSome):
136 (KJS::arrayProtoFuncIndexOf):
137 (KJS::arrayProtoFuncLastIndexOf):
138 (KJS::ArrayObjectImp::ArrayObjectImp):
139 (KJS::ArrayObjectImp::construct):
140 * kjs/bool_object.cpp:
141 (KJS::BooleanPrototype::BooleanPrototype):
142 (KJS::booleanProtoFuncToString):
143 (KJS::BooleanObjectImp::BooleanObjectImp):
144 (KJS::BooleanObjectImp::construct):
147 (KJS::allocateBlock):
148 (KJS::Collector::recordExtraCost):
149 (KJS::Collector::heapAllocate):
150 (KJS::Collector::allocate):
151 (KJS::Collector::allocateNumber):
152 (KJS::Collector::registerAsMainThread):
154 (KJS::PlatformThread::PlatformThread):
155 (KJS::getCurrentPlatformThread):
156 (KJS::Collector::Thread::Thread):
157 (KJS::destroyRegisteredThread):
158 (KJS::initializeRegisteredThreadKey):
159 (KJS::Collector::registerThread):
160 (KJS::Collector::markStackObjectsConservatively):
161 (KJS::Collector::markCurrentThreadConservativelyInternal):
162 (KJS::Collector::markCurrentThreadConservatively):
163 (KJS::suspendThread):
165 (KJS::getPlatformThreadRegisters):
166 (KJS::otherThreadStackPointer):
167 (KJS::Collector::markOtherThreadConservatively):
168 (KJS::protectedValues):
169 (KJS::Collector::protect):
170 (KJS::Collector::unprotect):
171 (KJS::Collector::collectOnMainThreadOnly):
172 (KJS::Collector::markProtectedObjects):
173 (KJS::Collector::markMainThreadOnlyObjects):
174 (KJS::Collector::sweep):
175 (KJS::Collector::collect):
176 (KJS::Collector::size):
177 (KJS::Collector::globalObjectCount):
178 (KJS::Collector::protectedGlobalObjectCount):
179 (KJS::Collector::protectedObjectCount):
180 (KJS::Collector::protectedObjectTypeCounts):
181 (KJS::Collector::isBusy):
182 (KJS::Collector::reportOutOfMemoryToAllExecStates):
185 (KJS::Collector::cellBlock):
186 (KJS::Collector::cellOffset):
187 (KJS::Collector::isCellMarked):
188 (KJS::Collector::markCell):
189 (KJS::Collector::reportExtraMemoryCost):
190 * kjs/date_object.cpp:
191 (KJS::formatLocaleDate):
192 (KJS::DatePrototype::DatePrototype):
193 (KJS::DateObjectImp::DateObjectImp):
194 (KJS::DateObjectImp::construct):
195 (KJS::DateObjectImp::callAsFunction):
196 (KJS::DateObjectFuncImp::DateObjectFuncImp):
197 (KJS::DateObjectFuncImp::callAsFunction):
198 (KJS::dateProtoFuncToString):
199 (KJS::dateProtoFuncToUTCString):
200 (KJS::dateProtoFuncToDateString):
201 (KJS::dateProtoFuncToTimeString):
202 (KJS::dateProtoFuncToLocaleString):
203 (KJS::dateProtoFuncToLocaleDateString):
204 (KJS::dateProtoFuncToLocaleTimeString):
205 (KJS::dateProtoFuncValueOf):
206 (KJS::dateProtoFuncGetTime):
207 (KJS::dateProtoFuncGetFullYear):
208 (KJS::dateProtoFuncGetUTCFullYear):
209 (KJS::dateProtoFuncToGMTString):
210 (KJS::dateProtoFuncGetMonth):
211 (KJS::dateProtoFuncGetUTCMonth):
212 (KJS::dateProtoFuncGetDate):
213 (KJS::dateProtoFuncGetUTCDate):
214 (KJS::dateProtoFuncGetDay):
215 (KJS::dateProtoFuncGetUTCDay):
216 (KJS::dateProtoFuncGetHours):
217 (KJS::dateProtoFuncGetUTCHours):
218 (KJS::dateProtoFuncGetMinutes):
219 (KJS::dateProtoFuncGetUTCMinutes):
220 (KJS::dateProtoFuncGetSeconds):
221 (KJS::dateProtoFuncGetUTCSeconds):
222 (KJS::dateProtoFuncGetMilliSeconds):
223 (KJS::dateProtoFuncGetUTCMilliseconds):
224 (KJS::dateProtoFuncGetTimezoneOffset):
225 (KJS::dateProtoFuncSetTime):
226 (KJS::setNewValueFromTimeArgs):
227 (KJS::setNewValueFromDateArgs):
228 (KJS::dateProtoFuncSetYear):
229 (KJS::dateProtoFuncGetYear):
230 * kjs/error_object.cpp:
231 (KJS::ErrorPrototype::ErrorPrototype):
232 (KJS::errorProtoFuncToString):
233 (KJS::ErrorObjectImp::ErrorObjectImp):
234 (KJS::ErrorObjectImp::construct):
235 (KJS::NativeErrorPrototype::NativeErrorPrototype):
236 (KJS::NativeErrorImp::NativeErrorImp):
237 (KJS::NativeErrorImp::construct):
239 (KJS::FunctionImp::lengthGetter):
240 (KJS::FunctionImp::construct):
241 (KJS::Arguments::Arguments):
242 (KJS::ActivationImp::createArgumentsObject):
245 (KJS::globalFuncParseInt):
246 (KJS::globalFuncParseFloat):
247 (KJS::globalFuncEscape):
248 (KJS::globalFuncUnescape):
249 (KJS::PrototypeFunction::PrototypeFunction):
250 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
251 * kjs/function_object.cpp:
252 (KJS::FunctionPrototype::FunctionPrototype):
253 (KJS::functionProtoFuncToString):
254 (KJS::FunctionObjectImp::FunctionObjectImp):
255 (KJS::FunctionObjectImp::construct):
257 (KJS::StringImp::toObject):
259 (KJS::StringImp::StringImp):
260 (KJS::NumberImp::operator new):
262 (KJS::List::markSet):
263 (KJS::List::markProtectedListsSlowCase):
264 (KJS::List::expandAndAppend):
268 (KJS::List::markProtectedLists):
270 (KJS::staticFunctionGetter):
271 (KJS::cacheGlobalObject):
272 * kjs/math_object.cpp:
273 (KJS::MathObjectImp::getValueProperty):
274 (KJS::mathProtoFuncAbs):
275 (KJS::mathProtoFuncACos):
276 (KJS::mathProtoFuncASin):
277 (KJS::mathProtoFuncATan):
278 (KJS::mathProtoFuncATan2):
279 (KJS::mathProtoFuncCeil):
280 (KJS::mathProtoFuncCos):
281 (KJS::mathProtoFuncExp):
282 (KJS::mathProtoFuncFloor):
283 (KJS::mathProtoFuncLog):
284 (KJS::mathProtoFuncMax):
285 (KJS::mathProtoFuncMin):
286 (KJS::mathProtoFuncPow):
287 (KJS::mathProtoFuncRandom):
288 (KJS::mathProtoFuncRound):
289 (KJS::mathProtoFuncSin):
290 (KJS::mathProtoFuncSqrt):
291 (KJS::mathProtoFuncTan):
293 (KJS::ParserRefCounted::ParserRefCounted):
294 (KJS::ParserRefCounted::ref):
295 (KJS::ParserRefCounted::deref):
296 (KJS::ParserRefCounted::refcount):
297 (KJS::ParserRefCounted::deleteNewObjects):
298 (KJS::Node::handleException):
299 (KJS::NumberNode::evaluate):
300 (KJS::StringNode::evaluate):
301 (KJS::ArrayNode::evaluate):
302 (KJS::PostIncResolveNode::evaluate):
303 (KJS::PostIncLocalVarNode::evaluate):
304 (KJS::PostDecResolveNode::evaluate):
305 (KJS::PostDecLocalVarNode::evaluate):
306 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
307 (KJS::PostIncBracketNode::evaluate):
308 (KJS::PostDecBracketNode::evaluate):
309 (KJS::PostIncDotNode::evaluate):
310 (KJS::PostDecDotNode::evaluate):
311 (KJS::typeStringForValue):
312 (KJS::LocalVarTypeOfNode::evaluate):
313 (KJS::TypeOfResolveNode::evaluate):
314 (KJS::TypeOfValueNode::evaluate):
315 (KJS::PreIncLocalVarNode::evaluate):
316 (KJS::PreIncResolveNode::evaluate):
317 (KJS::PreDecLocalVarNode::evaluate):
318 (KJS::PreDecResolveNode::evaluate):
319 (KJS::PreIncConstNode::evaluate):
320 (KJS::PreDecConstNode::evaluate):
321 (KJS::PostIncConstNode::evaluate):
322 (KJS::PostDecConstNode::evaluate):
323 (KJS::PreIncBracketNode::evaluate):
324 (KJS::PreDecBracketNode::evaluate):
325 (KJS::PreIncDotNode::evaluate):
326 (KJS::PreDecDotNode::evaluate):
327 (KJS::NegateNode::evaluate):
328 (KJS::BitwiseNotNode::evaluate):
329 (KJS::MultNode::evaluate):
330 (KJS::DivNode::evaluate):
331 (KJS::ModNode::evaluate):
334 (KJS::AddNumbersNode::evaluate):
335 (KJS::AddStringsNode::evaluate):
336 (KJS::AddStringLeftNode::evaluate):
337 (KJS::AddStringRightNode::evaluate):
338 (KJS::SubNode::evaluate):
339 (KJS::LeftShiftNode::evaluate):
340 (KJS::RightShiftNode::evaluate):
341 (KJS::UnsignedRightShiftNode::evaluate):
342 (KJS::BitXOrNode::evaluate):
343 (KJS::BitOrNode::evaluate):
344 (KJS::valueForReadModifyAssignment):
345 (KJS::ForInNode::execute):
346 (KJS::TryNode::execute):
347 (KJS::FuncDeclNode::makeFunction):
348 (KJS::FuncExprNode::evaluate):
350 * kjs/number_object.cpp:
351 (KJS::NumberPrototype::NumberPrototype):
352 (KJS::numberProtoFuncToString):
353 (KJS::numberProtoFuncToLocaleString):
354 (KJS::numberProtoFuncToFixed):
355 (KJS::numberProtoFuncToExponential):
356 (KJS::numberProtoFuncToPrecision):
357 (KJS::NumberObjectImp::NumberObjectImp):
358 (KJS::NumberObjectImp::getValueProperty):
359 (KJS::NumberObjectImp::construct):
360 (KJS::NumberObjectImp::callAsFunction):
362 (KJS::JSObject::call):
363 (KJS::JSObject::get):
364 (KJS::JSObject::put):
365 (KJS::JSObject::defineGetter):
366 (KJS::JSObject::defineSetter):
367 (KJS::JSObject::putDirect):
368 (KJS::Error::create):
370 * kjs/object_object.cpp:
371 (KJS::ObjectPrototype::ObjectPrototype):
372 (KJS::objectProtoFuncToLocaleString):
373 (KJS::objectProtoFuncToString):
374 (KJS::ObjectObjectImp::ObjectObjectImp):
375 (KJS::ObjectObjectImp::construct):
376 * kjs/property_map.h:
377 (KJS::SavedProperty::SavedProperty):
378 (KJS::SavedProperty::init):
379 (KJS::SavedProperty::~SavedProperty):
380 (KJS::SavedProperty::name):
381 (KJS::SavedProperty::value):
382 (KJS::SavedProperty::attributes):
386 * kjs/regexp_object.cpp:
387 (KJS::RegExpPrototype::RegExpPrototype):
388 (KJS::regExpProtoFuncToString):
389 (KJS::RegExpImp::getValueProperty):
390 (KJS::RegExpObjectImp::RegExpObjectImp):
391 (KJS::RegExpObjectImp::arrayOfMatches):
392 (KJS::RegExpObjectImp::getBackref):
393 (KJS::RegExpObjectImp::getLastParen):
394 (KJS::RegExpObjectImp::getLeftContext):
395 (KJS::RegExpObjectImp::getRightContext):
396 (KJS::RegExpObjectImp::getValueProperty):
397 (KJS::RegExpObjectImp::createRegExpImp):
398 * kjs/regexp_object.h:
399 * kjs/string_object.cpp:
400 (KJS::StringInstance::StringInstance):
401 (KJS::StringInstance::lengthGetter):
402 (KJS::StringInstance::indexGetter):
403 (KJS::stringInstanceNumericPropertyGetter):
404 (KJS::StringPrototype::StringPrototype):
406 (KJS::stringProtoFuncCharAt):
407 (KJS::stringProtoFuncCharCodeAt):
408 (KJS::stringProtoFuncConcat):
409 (KJS::stringProtoFuncIndexOf):
410 (KJS::stringProtoFuncLastIndexOf):
411 (KJS::stringProtoFuncMatch):
412 (KJS::stringProtoFuncSearch):
413 (KJS::stringProtoFuncReplace):
414 (KJS::stringProtoFuncSlice):
415 (KJS::stringProtoFuncSplit):
416 (KJS::stringProtoFuncSubstr):
417 (KJS::stringProtoFuncSubstring):
418 (KJS::stringProtoFuncToLowerCase):
419 (KJS::stringProtoFuncToUpperCase):
420 (KJS::stringProtoFuncToLocaleLowerCase):
421 (KJS::stringProtoFuncToLocaleUpperCase):
422 (KJS::stringProtoFuncLocaleCompare):
423 (KJS::stringProtoFuncBig):
424 (KJS::stringProtoFuncSmall):
425 (KJS::stringProtoFuncBlink):
426 (KJS::stringProtoFuncBold):
427 (KJS::stringProtoFuncFixed):
428 (KJS::stringProtoFuncItalics):
429 (KJS::stringProtoFuncStrike):
430 (KJS::stringProtoFuncSub):
431 (KJS::stringProtoFuncSup):
432 (KJS::stringProtoFuncFontcolor):
433 (KJS::stringProtoFuncFontsize):
434 (KJS::stringProtoFuncAnchor):
435 (KJS::stringProtoFuncLink):
436 (KJS::StringObjectImp::StringObjectImp):
437 (KJS::StringObjectImp::construct):
438 (KJS::StringObjectImp::callAsFunction):
439 (KJS::StringObjectFuncImp::StringObjectFuncImp):
440 (KJS::StringObjectFuncImp::callAsFunction):
441 * kjs/string_object.h:
442 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
444 (GlobalObject::GlobalObject):
451 (KJS::JSCell::operator new):
453 (KJS::jsOwnedString):
458 (KJS::jsNumberFromAnd):
459 (KJS::JSCell::marked):
461 (KJS::JSValue::toJSNumber):
462 * wtf/ThreadSpecific.h:
465 2008-05-10 Julien Chaffraix <jchaffraix@webkit.org>
469 * JavaScriptCore.pri: Add profiler/Profile.cpp.
470 * JavaScriptCoreSources.bkl: Ditto.
472 2008-05-10 Jan Michael Alonzo <jmalonzo@unpluggable.com>
478 * GNUmakefile.am: Add Profile.cpp in _sources
480 2008-05-09 Brady Eidson <beidson@apple.com>
482 Build Fix. Kevin is an idiot.
483 ("My name is Kevin McCullough and I approve this message.")
485 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
487 2008-05-09 Kevin McCullough <kmccullough@apple.com>
491 -<rdar://problem/5770054> JavaScript profiler (10928)
492 -Add Profile class so that all profiles can be stored and retrieved by
493 the WebInspector when that time comes.
495 * JavaScriptCore.exp: Export the new function signatures.
496 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the
498 * profiler/Profile.cpp: Added. This class represents a single run of the
500 (KJS::Profile::Profile):
501 (KJS::Profile::willExecute):
502 (KJS::Profile::didExecute):
503 (KJS::Profile::printDataInspectorStyle):
504 (KJS::functionNameCountPairComparator):
505 (KJS::Profile::printDataSampleStyle):
506 * profiler/Profile.h: Added. Ditto
507 (KJS::Profile::stopProfiling):
508 * profiler/Profiler.cpp: Now the profiler keeps track of many profiles
509 but only runs one at a time.
510 (KJS::Profiler::startProfiling):
511 (KJS::Profiler::stopProfiling):
512 (KJS::Profiler::willExecute):
513 (KJS::Profiler::didExecute):
514 (KJS::Profiler::printDataInspectorStyle):
515 (KJS::Profiler::printDataSampleStyle):
516 * profiler/Profiler.h: Ditto.
517 (KJS::Profiler::~Profiler):
518 (KJS::Profiler::allProfiles):
519 (KJS::Profiler::clearProfiles):
521 2008-05-08 Anders Carlsson <andersca@apple.com>
525 Enable NPAPI plug-ins on 64-bit.
529 2008-05-07 Julien Chaffraix <jchaffraix@webkit.org>
531 Reviewed by Adam Roben.
535 Add SIZE_MAX definition for the wx port.
539 2008-05-07 Ariya Hidayat <ariya.hidayat@trolltech.com>
543 Support for isMainThread in the Qt port.
545 * wtf/ThreadingQt.cpp:
546 (WTF::initializeThreading): Adjusted.
547 (WTF::isMainThread): Added.
549 2008-05-05 Darin Adler <darin@apple.com>
551 Reviewed by John Sullivan.
553 - fix debug-only leak seen on buildbot
556 (WTF::HashTable::checkKey): After writing an empty value in, but before constructing a
557 deleted value on top of it, call the destructor so the empty value doesn't leak.
559 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
561 Reviewed by Geoffrey Garen.
563 Get rid of static data in nodes.cpp (well, at least of non-debug one).
565 No measurable change on SunSpider.
567 * kjs/InitializeThreading.cpp:
568 (KJS::initializeThreadingOnce):
570 (KJS::newTrackedObjects):
571 (KJS::trackedObjectExtraRefCounts):
572 (KJS::initializeNodesThreading):
573 (KJS::ParserRefCounted::ParserRefCounted):
574 (KJS::ParserRefCounted::ref):
575 (KJS::ParserRefCounted::deref):
576 (KJS::ParserRefCounted::refcount):
577 (KJS::ParserRefCounted::deleteNewObjects):
579 Made newTrackedObjects and trackedObjectExtraRefCounts per-thread.
581 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
585 Move call stack depth counter to global object.
587 * kjs/ExecState.h: (KJS::ExecState::functionCallDepth): Added a recursion depth counter to
589 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Initialize PerThreadData.functionCallDepth.
590 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::perThreadData): Made the result non-const.
593 (KJS::throwStackSizeExceededError): Moved throwError to a separate function, since it is now
594 the only thing in JSObject::call that needs a PIC branch.
595 (KJS::JSObject::call): Use a per-thread variable instead of local static for recursion depth
598 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
602 Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
603 for the sake of non-WebKit clients.
607 * API/JSContextRef.cpp:
608 (JSGlobalContextCreate):
609 These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
610 and JSClassRef functions that can be called earlier, but they do not do anything that
611 requires initializeThreading.
613 * kjs/InitializeThreading.cpp:
614 (KJS::doInitializeThreading):
615 (KJS::initializeThreading):
616 On Darwin, make the initialization happen under pthread_once, since there is no guarantee
617 that non-WebKit clients won't try to call this function re-entrantly.
619 * kjs/InitializeThreading.h:
621 Spell out initializeThreading contract.
623 * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
624 Darwin, even if threading was initialized from a secondary thread.
626 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
628 Reviewed by Geoffrey Garen.
630 https://bugs.webkit.org/show_bug.cgi?id=18826
631 Make JavaScript heap per-thread
633 * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
634 (replaced "new T" with "new T()").
636 * kjs/collector.h: Renamed Collector to Heap, made the heap per-thread. Removed support for
637 multithreaded access to a heap.
638 (KJS::CollectorBlock): Removed collectOnMainThreadOnly bitmap, added a reference to owner heap.
639 (KJS::SmallCellCollectorBlock): Ditto.
640 (KJS::Heap::markListSet): Moved from a static variable in List.cpp to a per-thread one here.
641 (KJS::Heap::heap): Added a method to find which heap a JSValue is allocated in.
643 * kjs/collector.cpp: Changed "const size_t" constants to #defines, to avoid a PIC branch
644 (gcc was using one to access a constant used in std::max(), because it takes a reference,
645 even though std::max() itself was inlined).
646 (KJS::Heap::threadHeap): JS heap is now per-thread.
647 (KJS::Heap::Heap): Zero-initialize the heap.
648 (KJS::allocateBlock): Added NEVER_INLINE, because this function uses a PIC branch, so
649 inlining it in Heap::heapAllocate() is bad for performance, now that the latter doesn't
651 (KJS::Heap::heapAllocate): Initialize Block::heap.
652 (KJS::Heap::markCurrentThreadConservatively): Moved into markStackObjectsConservatively(),
653 as GC only works with a current thread's heap now.
654 (KJS::Heap::sweep): Removed collectOnMainThreadOnly checks.
655 (KJS::Heap::collect): Ditto.
659 (KJS::JSLock::JSLock):
660 Removed registerThread(), as the heap no longer cares.
662 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize new per-thread
663 variables in Heap and JSGlobalObject.
665 * kjs/ExecState.h: (KJS::ExecState::heap): Added a heap pointer for faster access to
666 per-thread heap, and an accessor for it.
668 * kjs/JSGlobalObject.h: Made JSGlobalObject linked list per-thread.
669 * kjs/JSGlobalObject.cpp:
670 (KJS::JSGlobalObject::~JSGlobalObject): Fixed a bug in linked list handling. It only worked
671 right if the removed object was the head one!
672 (KJS::JSGlobalObject::head): Return a per-thread list head.
673 (KJS::JSGlobalObject::init): Store a reference to per-thread heap.
674 (KJS::JSGlobalObject::reset): Pass ExecState to functions that need it.
675 (KJS::JSGlobalObject::tearOffActivation): Ditto.
676 (KJS::JSGlobalObject::operator new): JSGlobalObject allocation cannot use an ExecState,
677 so it needs a custom operator new that directly accesses per-thread heap.
680 (KJS::List::List): Replaced m_isInMarkSet boolean with an actual pointer to the set, since it
681 is no longer a single static object.
682 (KJS::List::~List): Ditto.
684 (KJS::List::markSet): Removed, this is now stored in Heap.
685 (KJS::List::markProtectedLists): Take a reference to the list.
686 (KJS::List::expandAndAppend): Ask the current thread heap for a mark set reference.
691 Use the newly added Heap::heap() method to find out which heap the value to be (un)protected
694 * kjs/property_map.h: Removed unused SavedProperty class.
696 * JavaScriptCore.exp:
699 * API/JSCallbackObjectFunctions.h:
700 (KJS::::staticFunctionGetter):
701 * API/JSClassRef.cpp:
702 (OpaqueJSClass::prototype):
703 * API/JSObjectRef.cpp:
705 (JSObjectMakeFunctionWithCallback):
706 (JSObjectMakeConstructor):
707 (JSObjectMakeFunction):
708 * API/JSValueRef.cpp:
711 * kjs/array_instance.cpp:
712 (KJS::ArrayInstance::ArrayInstance):
713 (KJS::ArrayInstance::lengthGetter):
714 * kjs/array_object.cpp:
715 (KJS::arrayProtoFuncToString):
716 (KJS::arrayProtoFuncToLocaleString):
717 (KJS::arrayProtoFuncJoin):
718 (KJS::arrayProtoFuncConcat):
719 (KJS::arrayProtoFuncPop):
720 (KJS::arrayProtoFuncPush):
721 (KJS::arrayProtoFuncShift):
722 (KJS::arrayProtoFuncSlice):
723 (KJS::arrayProtoFuncSplice):
724 (KJS::arrayProtoFuncUnShift):
725 (KJS::arrayProtoFuncFilter):
726 (KJS::arrayProtoFuncMap):
727 (KJS::arrayProtoFuncEvery):
728 (KJS::arrayProtoFuncForEach):
729 (KJS::arrayProtoFuncSome):
730 (KJS::arrayProtoFuncIndexOf):
731 (KJS::arrayProtoFuncLastIndexOf):
732 (KJS::ArrayObjectImp::ArrayObjectImp):
733 (KJS::ArrayObjectImp::construct):
734 * kjs/bool_object.cpp:
735 (KJS::BooleanPrototype::BooleanPrototype):
736 (KJS::booleanProtoFuncToString):
737 (KJS::BooleanObjectImp::BooleanObjectImp):
738 (KJS::BooleanObjectImp::construct):
739 * kjs/date_object.cpp:
740 (KJS::formatLocaleDate):
741 (KJS::DatePrototype::DatePrototype):
742 (KJS::DateObjectImp::DateObjectImp):
743 (KJS::DateObjectImp::construct):
744 (KJS::DateObjectImp::callAsFunction):
745 (KJS::DateObjectFuncImp::DateObjectFuncImp):
746 (KJS::DateObjectFuncImp::callAsFunction):
747 (KJS::dateProtoFuncToString):
748 (KJS::dateProtoFuncToUTCString):
749 (KJS::dateProtoFuncToDateString):
750 (KJS::dateProtoFuncToTimeString):
751 (KJS::dateProtoFuncToLocaleString):
752 (KJS::dateProtoFuncToLocaleDateString):
753 (KJS::dateProtoFuncToLocaleTimeString):
754 (KJS::dateProtoFuncValueOf):
755 (KJS::dateProtoFuncGetTime):
756 (KJS::dateProtoFuncGetFullYear):
757 (KJS::dateProtoFuncGetUTCFullYear):
758 (KJS::dateProtoFuncToGMTString):
759 (KJS::dateProtoFuncGetMonth):
760 (KJS::dateProtoFuncGetUTCMonth):
761 (KJS::dateProtoFuncGetDate):
762 (KJS::dateProtoFuncGetUTCDate):
763 (KJS::dateProtoFuncGetDay):
764 (KJS::dateProtoFuncGetUTCDay):
765 (KJS::dateProtoFuncGetHours):
766 (KJS::dateProtoFuncGetUTCHours):
767 (KJS::dateProtoFuncGetMinutes):
768 (KJS::dateProtoFuncGetUTCMinutes):
769 (KJS::dateProtoFuncGetSeconds):
770 (KJS::dateProtoFuncGetUTCSeconds):
771 (KJS::dateProtoFuncGetMilliSeconds):
772 (KJS::dateProtoFuncGetUTCMilliseconds):
773 (KJS::dateProtoFuncGetTimezoneOffset):
774 (KJS::dateProtoFuncSetTime):
775 (KJS::setNewValueFromTimeArgs):
776 (KJS::setNewValueFromDateArgs):
777 (KJS::dateProtoFuncSetYear):
778 (KJS::dateProtoFuncGetYear):
779 * kjs/error_object.cpp:
780 (KJS::ErrorPrototype::ErrorPrototype):
781 (KJS::errorProtoFuncToString):
782 (KJS::ErrorObjectImp::ErrorObjectImp):
783 (KJS::ErrorObjectImp::construct):
784 (KJS::NativeErrorPrototype::NativeErrorPrototype):
785 (KJS::NativeErrorImp::NativeErrorImp):
786 (KJS::NativeErrorImp::construct):
788 (KJS::FunctionImp::lengthGetter):
789 (KJS::FunctionImp::construct):
790 (KJS::Arguments::Arguments):
791 (KJS::ActivationImp::createArgumentsObject):
794 (KJS::globalFuncParseInt):
795 (KJS::globalFuncParseFloat):
796 (KJS::globalFuncEscape):
797 (KJS::globalFuncUnescape):
798 (KJS::PrototypeFunction::PrototypeFunction):
799 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
800 * kjs/function_object.cpp:
801 (KJS::FunctionPrototype::FunctionPrototype):
802 (KJS::functionProtoFuncToString):
803 (KJS::FunctionObjectImp::FunctionObjectImp):
804 (KJS::FunctionObjectImp::construct):
806 (KJS::StringImp::toObject):
808 (KJS::StringImp::StringImp):
809 (KJS::NumberImp::operator new):
811 (KJS::staticFunctionGetter):
812 (KJS::cacheGlobalObject):
813 * kjs/math_object.cpp:
814 (KJS::MathObjectImp::getValueProperty):
815 (KJS::mathProtoFuncAbs):
816 (KJS::mathProtoFuncACos):
817 (KJS::mathProtoFuncASin):
818 (KJS::mathProtoFuncATan):
819 (KJS::mathProtoFuncATan2):
820 (KJS::mathProtoFuncCeil):
821 (KJS::mathProtoFuncCos):
822 (KJS::mathProtoFuncExp):
823 (KJS::mathProtoFuncFloor):
824 (KJS::mathProtoFuncLog):
825 (KJS::mathProtoFuncMax):
826 (KJS::mathProtoFuncMin):
827 (KJS::mathProtoFuncPow):
828 (KJS::mathProtoFuncRandom):
829 (KJS::mathProtoFuncRound):
830 (KJS::mathProtoFuncSin):
831 (KJS::mathProtoFuncSqrt):
832 (KJS::mathProtoFuncTan):
834 (KJS::Node::handleException):
835 (KJS::NumberNode::evaluate):
836 (KJS::StringNode::evaluate):
837 (KJS::ArrayNode::evaluate):
838 (KJS::PostIncResolveNode::evaluate):
839 (KJS::PostIncLocalVarNode::evaluate):
840 (KJS::PostDecResolveNode::evaluate):
841 (KJS::PostDecLocalVarNode::evaluate):
842 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
843 (KJS::PostIncBracketNode::evaluate):
844 (KJS::PostDecBracketNode::evaluate):
845 (KJS::PostIncDotNode::evaluate):
846 (KJS::PostDecDotNode::evaluate):
847 (KJS::typeStringForValue):
848 (KJS::LocalVarTypeOfNode::evaluate):
849 (KJS::TypeOfResolveNode::evaluate):
850 (KJS::TypeOfValueNode::evaluate):
851 (KJS::PreIncLocalVarNode::evaluate):
852 (KJS::PreIncResolveNode::evaluate):
853 (KJS::PreDecLocalVarNode::evaluate):
854 (KJS::PreDecResolveNode::evaluate):
855 (KJS::PreIncConstNode::evaluate):
856 (KJS::PreDecConstNode::evaluate):
857 (KJS::PostIncConstNode::evaluate):
858 (KJS::PostDecConstNode::evaluate):
859 (KJS::PreIncBracketNode::evaluate):
860 (KJS::PreDecBracketNode::evaluate):
861 (KJS::PreIncDotNode::evaluate):
862 (KJS::PreDecDotNode::evaluate):
863 (KJS::NegateNode::evaluate):
864 (KJS::BitwiseNotNode::evaluate):
865 (KJS::MultNode::evaluate):
866 (KJS::DivNode::evaluate):
867 (KJS::ModNode::evaluate):
870 (KJS::AddNumbersNode::evaluate):
871 (KJS::AddStringsNode::evaluate):
872 (KJS::AddStringLeftNode::evaluate):
873 (KJS::AddStringRightNode::evaluate):
874 (KJS::SubNode::evaluate):
875 (KJS::LeftShiftNode::evaluate):
876 (KJS::RightShiftNode::evaluate):
877 (KJS::UnsignedRightShiftNode::evaluate):
878 (KJS::BitXOrNode::evaluate):
879 (KJS::BitOrNode::evaluate):
880 (KJS::valueForReadModifyAssignment):
881 (KJS::ForInNode::execute):
882 (KJS::TryNode::execute):
883 (KJS::FuncDeclNode::makeFunction):
884 (KJS::FuncExprNode::evaluate):
885 * kjs/number_object.cpp:
886 (KJS::NumberPrototype::NumberPrototype):
887 (KJS::numberProtoFuncToString):
888 (KJS::numberProtoFuncToLocaleString):
889 (KJS::numberProtoFuncToFixed):
890 (KJS::numberProtoFuncToExponential):
891 (KJS::numberProtoFuncToPrecision):
892 (KJS::NumberObjectImp::NumberObjectImp):
893 (KJS::NumberObjectImp::getValueProperty):
894 (KJS::NumberObjectImp::construct):
895 (KJS::NumberObjectImp::callAsFunction):
897 (KJS::JSObject::defineGetter):
898 (KJS::JSObject::defineSetter):
899 (KJS::JSObject::putDirect):
900 (KJS::Error::create):
902 * kjs/object_object.cpp:
903 (KJS::ObjectPrototype::ObjectPrototype):
904 (KJS::objectProtoFuncToLocaleString):
905 (KJS::objectProtoFuncToString):
906 (KJS::ObjectObjectImp::ObjectObjectImp):
907 (KJS::ObjectObjectImp::construct):
908 * kjs/regexp_object.cpp:
909 (KJS::RegExpPrototype::RegExpPrototype):
910 (KJS::regExpProtoFuncToString):
911 (KJS::RegExpImp::getValueProperty):
912 (KJS::RegExpObjectImp::RegExpObjectImp):
913 (KJS::RegExpObjectImp::arrayOfMatches):
914 (KJS::RegExpObjectImp::getBackref):
915 (KJS::RegExpObjectImp::getLastParen):
916 (KJS::RegExpObjectImp::getLeftContext):
917 (KJS::RegExpObjectImp::getRightContext):
918 (KJS::RegExpObjectImp::getValueProperty):
919 (KJS::RegExpObjectImp::createRegExpImp):
920 * kjs/regexp_object.h:
921 * kjs/string_object.cpp:
922 (KJS::StringInstance::StringInstance):
923 (KJS::StringInstance::lengthGetter):
924 (KJS::StringInstance::indexGetter):
925 (KJS::stringInstanceNumericPropertyGetter):
926 (KJS::StringPrototype::StringPrototype):
928 (KJS::stringProtoFuncCharAt):
929 (KJS::stringProtoFuncCharCodeAt):
930 (KJS::stringProtoFuncConcat):
931 (KJS::stringProtoFuncIndexOf):
932 (KJS::stringProtoFuncLastIndexOf):
933 (KJS::stringProtoFuncMatch):
934 (KJS::stringProtoFuncSearch):
935 (KJS::stringProtoFuncReplace):
936 (KJS::stringProtoFuncSlice):
937 (KJS::stringProtoFuncSplit):
938 (KJS::stringProtoFuncSubstr):
939 (KJS::stringProtoFuncSubstring):
940 (KJS::stringProtoFuncToLowerCase):
941 (KJS::stringProtoFuncToUpperCase):
942 (KJS::stringProtoFuncToLocaleLowerCase):
943 (KJS::stringProtoFuncToLocaleUpperCase):
944 (KJS::stringProtoFuncLocaleCompare):
945 (KJS::stringProtoFuncBig):
946 (KJS::stringProtoFuncSmall):
947 (KJS::stringProtoFuncBlink):
948 (KJS::stringProtoFuncBold):
949 (KJS::stringProtoFuncFixed):
950 (KJS::stringProtoFuncItalics):
951 (KJS::stringProtoFuncStrike):
952 (KJS::stringProtoFuncSub):
953 (KJS::stringProtoFuncSup):
954 (KJS::stringProtoFuncFontcolor):
955 (KJS::stringProtoFuncFontsize):
956 (KJS::stringProtoFuncAnchor):
957 (KJS::stringProtoFuncLink):
958 (KJS::StringObjectImp::StringObjectImp):
959 (KJS::StringObjectImp::construct):
960 (KJS::StringObjectImp::callAsFunction):
961 (KJS::StringObjectFuncImp::StringObjectFuncImp):
962 (KJS::StringObjectFuncImp::callAsFunction):
963 * kjs/string_object.h:
964 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
966 (GlobalObject::GlobalObject):
973 (KJS::JSCell::operator new):
975 (KJS::jsOwnedString):
980 (KJS::jsNumberFromAnd):
981 (KJS::JSCell::marked):
983 (KJS::JSValue::toJSNumber):
984 Removed collectOnMainThreadOnly, as this is the only way to collect now. Replaced calls to
985 static Collector methods with calls to per-thread Heap ones.
987 2008-05-02 Dan Bernstein <mitz@apple.com>
989 Reviewed by Maciej Stachowiak.
993 * wtf/StrHash.h: Added header guards and removed #include "config.h".
995 2008-05-01 Ada Chan <adachan@apple.com>
997 #include <wtf/StrHash.h> in identifier.cpp.
1001 * kjs/identifier.cpp:
1003 2008-05-01 Steve Falkenburg <sfalken@apple.com>
1007 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1009 2008-05-01 Sam Weinig <sam@webkit.org>
1013 * JavaScriptCore.xcodeproj/project.pbxproj:
1015 2008-05-01 Kevin McCullough <kmccullough@apple.com>
1019 <rdar://problem/5770054> JavaScript profiler (10928)
1020 - Fix "sample" output so that it can be imported into Instruments
1021 - Also keep track of number of times a function is profiled.
1023 * JavaScriptCore.xcodeproj/project.pbxproj: Add StrHash.h which needed
1024 to be pulled out of identifier.cpp so that it could be used by the
1025 profiler and identifiers.
1026 * kjs/identifier.cpp: Ditto.
1027 * profiler/FunctionCallProfile.cpp:
1028 (KJS::FunctionCallProfile::printDataInspectorStyle): Inspector style
1029 printing should show microseconds.
1030 (KJS::FunctionCallProfile::printDataSampleStyle): Sample style printing
1031 now counts the number of times a function is in the stack tree and does
1032 not print microseconds since that does not make sense for a sampler.
1033 * profiler/FunctionCallProfile.h: Keep track of number of times a
1034 function is profiled.
1035 (KJS::FunctionCallProfile::numberOfCalls):
1036 * profiler/Profiler.cpp:
1037 (KJS::functionNameCountPairComparator): Comparator for sort function in
1038 printDataSampleStyle.
1039 (KJS::Profiler::printDataSampleStyle): Print the number of times that a
1040 function is listed in the stack tree in order of most times listed.
1041 * wtf/HashCountedSet.h: Added copyToVector since it didn't exist and is
1042 a more standard way to copy a HashSet to a Vector. I added on variant
1043 that takes a pair as the Vector's type and so the HashCountedSet simply
1044 fills in that pair with its internal pair, and another variant that
1045 takes a Vector of the type of the HashCountedSet and only fills in the
1046 Vector with the first element of the pair.
1047 (WTF::copyToVector):
1048 * wtf/StrHash.h: Added.
1051 2008-04-29 David Kilzer <ddkilzer@apple.com>
1053 BUILD FIX for ENABLE(DASHBOARD_SUPPORT)
1055 * wtf/Platform.h: Defined ENABLE(DASHBOARD_SUPPORT) to 1 only for
1056 PLATFORM(MAC) and PLATFORM(WIN). Changed default to 0 for other
1059 2008-04-29 Greg Bolsinga <bolsinga@apple.com>
1063 Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
1067 2008-04-29 Kevin McCullough <kmccullough@apple.com>
1071 -<rdar://problem/5770054> JavaScript profiler (10928)
1074 * profiler/FunctionCallProfile.cpp:
1075 (KJS::FunctionCallProfile::FunctionCallProfile):
1076 (KJS::FunctionCallProfile::didExecute): Implements call count and fixed a bug where a stackIndex
1077 of 0 was causing the assert to be hit.
1078 (KJS::FunctionCallProfile::stopProfiling):
1079 (KJS::FunctionCallProfile::endAndRecordCall):
1080 * profiler/FunctionCallProfile.h:
1082 2008-04-29 Simon Hausmann <hausmann@webkit.org>
1084 Qt/Windows build fix. The externally declared hash tables are actually
1085 declared const and the const is mangled in the symbol name, so when
1086 importing they also need to be marked const.
1088 When compiling without MULTIPLE_THREADS use a const HashTable&
1089 instead of a HashTable& in ThreadClassInfoHashTables to avoid
1090 initializing the latter with a const reference.
1092 * kjs/JSGlobalObject.cpp:
1094 2008-04-28 Alexey Proskuryakov <ap@webkit.org>
1098 * kjs/ExecState.h: For whatever reason, MSVC couldn't generate a default constructor for
1099 a struct that had a "const List" member. Removing the const qulifier makes the problem go away.
1101 2008-04-28 Alexey Proskuryakov <ap@webkit.org>
1105 Fix run-webkit-tests --threading
1106 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
1107 Proxy server issue in Sunday's Nightly
1109 Changed ClassInfo objects for built-in objects to hold a getter function returning
1110 a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
1111 and these are the only ones that need to be shared.
1114 (KJS::Lexer::Lexer):
1115 (KJS::Lexer::~Lexer):
1117 Made mainTable a member of Lexer, so that it no longer needs to be shared between threads.
1120 (KJS::JSObject::deleteProperty):
1121 (KJS::JSObject::findPropertyHashEntry):
1122 (KJS::JSObject::propertyIsEnumerable):
1123 (KJS::JSObject::getPropertyAttributes):
1124 (KJS::JSObject::getPropertyNames):
1126 (KJS::ClassInfo::propHashTable):
1127 Added a new classPropHashTableGetterFunction field to ClassInfo. If it is non-zero, the
1128 static table is not used.
1130 * kjs/JSGlobalObject.cpp:
1131 (KJS::ThreadClassInfoHashTables::ThreadClassInfoHashTables): This new class holds per-thread
1132 HashTables for built-in classes. The old static structs are copied to create per-thread
1134 (KJS::JSGlobalObject::threadClassInfoHashTables): An accessor/initializer for the above.
1135 (KJS::JSGlobalObject::init): Copy per-thread data into a single structure for faster access.
1136 Also, construct globalExec.
1137 (KJS::JSGlobalObject::reset): Adapted for globalExec now being an OwnPtr.
1138 (KJS::JSGlobalObject::mark): Ditto.
1139 (KJS::JSGlobalObject::globalExec): Ditto.
1140 * kjs/JSGlobalObject.h:
1141 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Made JSGlobalObject::JSGlobalObjectData::globalExec an OwnPtr, so that it can
1142 be initialized from JSGlobalObject::init() after them. Otherwise, ExecState constructor was
1143 trying to access half-initialized JSGlobalObject to make its own copy of these table
1144 references, and failed.
1145 (KJS::JSGlobalObject::JSGlobalObject): Pass "this" value to init() to create globalExec.
1146 (KJS::JSGlobalObject::perThreadData): An accessor for per-thread data.
1148 * kjs/ExecState.cpp:
1149 (KJS::ExecState::ExecState):
1151 (KJS::ExecState::propertyNames):
1152 (KJS::ExecState::emptyList):
1153 (KJS::ExecState::arrayTable):
1154 (KJS::ExecState::dateTable):
1155 (KJS::ExecState::mathTable):
1156 (KJS::ExecState::numberTable):
1157 (KJS::ExecState::RegExpImpTable):
1158 (KJS::ExecState::RegExpObjectImpTable):
1159 (KJS::ExecState::stringTable):
1160 * kjs/ExecStateInlines.h:
1161 (KJS::ExecState::ExecState):
1162 Each ExecState holds its own reference to per-thread data, for even faster access. Moved
1163 m_emptyList and m_propertyNames to the same structure, making ExecState faster to construct
1164 and take less space on the stack.
1166 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize thread-static data
1167 added to JSGlobalObject.
1169 * API/JSCallbackConstructor.cpp:
1171 * API/JSCallbackFunction.cpp:
1173 * API/JSCallbackObject.cpp:
1175 * JavaScriptCore.exp:
1176 * kjs/JSVariableObject.cpp:
1177 (KJS::JSVariableObject::getPropertyAttributes):
1178 * kjs/JSVariableObject.h:
1179 * kjs/array_instance.cpp:
1181 * kjs/array_object.cpp:
1183 (KJS::ArrayPrototype::getOwnPropertySlot):
1184 * kjs/bool_object.cpp:
1186 * kjs/create_hash_table:
1187 * kjs/date_object.cpp:
1189 (KJS::DatePrototype::getOwnPropertySlot):
1190 (KJS::DateObjectImp::DateObjectImp):
1191 * kjs/error_object.cpp:
1195 * kjs/function_object.cpp:
1196 (KJS::FunctionPrototype::FunctionPrototype):
1200 * kjs/math_object.cpp:
1202 (KJS::MathObjectImp::getOwnPropertySlot):
1203 * kjs/number_object.cpp:
1205 (KJS::NumberObjectImp::getOwnPropertySlot):
1206 * kjs/object_object.cpp:
1207 (KJS::ObjectPrototype::ObjectPrototype):
1208 * kjs/regexp_object.cpp:
1210 (KJS::RegExpPrototype::RegExpPrototype):
1211 (KJS::RegExpImp::getOwnPropertySlot):
1212 (KJS::RegExpImp::put):
1213 (KJS::RegExpObjectImp::getOwnPropertySlot):
1214 (KJS::RegExpObjectImp::put):
1215 * kjs/string_object.cpp:
1217 (KJS::StringPrototype::getOwnPropertySlot):
1218 Adjust for the above changes.
1220 2008-04-28 Darin Adler <darin@apple.com>
1224 - make sure RefPtr's default hash doesn't ref/deref when computing the hash
1225 - remove remnants of the hash table storage type optimization
1227 * wtf/HashFunctions.h: Used "using" to get the hash and equal functions
1228 from PtrHash<P*> into PtrHash<RefPtr<P>>.
1230 * wtf/HashMap.h: Replaced uses of PairBaseHashTraits with PairHashTraits.
1231 Eliminated storage-related typedefs. Removed constructor, destructor,
1232 copy constructor, and destructor since the compiler-generated ones are
1233 fine. Removed refAll and derefAll. Took out unnnecessary typecasts.
1234 Removed use of RefCounter.
1236 * wtf/HashSet.h: Eliminated storage-related typedefs. Removed constructor,
1237 destructor, copy constructor, and destructor since the compiler-generated
1238 ones are fine. Removed refAll and derefAll. Removed unneeded template
1239 arguents from HashSetTranslatorAdapter. Eliminated unneeded HashSetTranslator
1242 * wtf/HashTable.h: Tweaked formatting. Removed NeedsRef, RefCounterBase,
1243 RefCounter, HashTableRefCounterBase, HashTableRefCounter, and Assigner
1246 * wtf/HashTraits.h: Removed StorageTraits, needsRef, PairBaseHashTraits,
1247 and HashKeyStorageTraits.
1249 * wtf/RefPtrHashMap.h: Made all the same fixes as in HashMap. Also made
1250 the corresponding changes to RefPtrHashMapRawKeyTranslator.
1252 2008-04-28 Darin Adler <darin@apple.com>
1256 - fix assertion hit every time you view www.apple.com
1258 * kjs/PropertyNameArray.cpp:
1259 (KJS::PropertyNameArray::add): Changed assertion to allow null and empty strings.
1260 Now to find out why we have a property named "" and if that's a bug!
1262 2008-04-27 Mark Rowe <mrowe@apple.com>
1264 Reviewed by Maciej Stachowiak.
1266 Fix crash inside PtrHash::hash when loading a page.
1268 * wtf/HashFunctions.h: Explicitly use the superclass implementation of hash to avoid infinite recursion.
1270 2008-04-27 Darin Adler <darin@apple.com>
1274 - fix <rdar://problem/5657459> REGRESSION: JavaScriptCore no longer builds with
1275 GCC 4.2 due to pointer aliasing warnings
1277 Fix this by removing the HashTable optimizations that allowed us to share a back end
1278 implementation between hash tables with integers, pointers, RefPtr, and String objects
1279 as keys. The way it worked was incompatible with strict aliasing.
1281 This increases code size. On Mac OS X we'll have to regenerate .order files to avoid
1282 slowing down Safari startup times.
1284 This creates a slight slowdown in SunSpider, mitigated by the following four speedups:
1286 - speed up array put slightly by moving a branch (was already done for get)
1288 - speed up symbol table access by adding a function named inlineGet to HashMap
1289 and using that in symbolTableGet/Put
1291 - speed up PropertyNameArray creation by reducing the amount of reference count
1292 churn and uniqueness checking when adding names and not doing any allocation at
1293 all when building small arrays
1295 - speed up conversion of strings to floating point numbers by eliminating the
1296 malloc/free of the buffer for the ASCII copy of the string; a way to make
1297 things even faster would be to change strtod to take a UTF-16 string
1299 Note that there is considerable unused complexity now in HashSet/Map/Table to support
1300 "storage types", which is no longer used. Will do in a separate patch.
1302 * API/JSCallbackObjectFunctions.h:
1303 (KJS::JSCallbackObject<Base>::getPropertyNames): Removed explicit cast to Identifier to
1304 take advantage of the new PropertyNameArray::add overload and avoid reference count churn.
1305 * API/JSObjectRef.cpp:
1306 (JSPropertyNameAccumulatorAddName): Ditto.
1307 * JavaScriptCore.exp: Updated PropertyNameArray::add entry point name.
1309 * kjs/JSVariableObject.cpp: Removed now-unneeded IdentifierRepHashTraits::nullRepPtr
1310 definition (see below).
1311 (KJS::JSVariableObject::getPropertyNames): Removed explicit cast to Identifier.
1313 * kjs/JSVariableObject.h:
1314 (KJS::JSVariableObject::symbolTableGet): Use inlineGet for speed. Also changed to do
1315 early exit instead of nesting the body inside an if.
1316 (KJS::JSVariableObject::symbolTablePut): Ditto.
1318 * kjs/PropertyNameArray.cpp:
1319 (KJS::PropertyNameArray::add): Changed implementation to take a raw pointer instead of
1320 a reference to an identifier. Do uniqueness checking by searching the vector when the
1321 vector is short, only building the set once the vector is large enough.
1323 * kjs/PropertyNameArray.h: Added an overload of add for a raw pointer, and made the old
1324 add function call that one. Added an addKnownUnique function for use when the new
1325 name is known to be different from any other in the array. Changed the vector to have
1326 an inline capacity of 20.
1328 * kjs/SymbolTable.h: Changed IdentifierRepHash to inherit from the default hash for
1329 a RefPtr so we don't have to define so much. Added an overload of the hash function for
1330 a raw pointer as required by the new RefPtrHashMap. Got rid of the now-unneeded
1331 IdentifierRepHashTraits -- the default traits now work fine. Added a definition of
1332 empthValueIsZero to SymbolTableIndexHashTraits; not having it was incorrect, but harmless.
1334 * kjs/array_instance.cpp:
1335 (KJS::ArrayInstance::put): Move the maxArrayIndex check inside the branch that checks
1336 the index against the length, as done in the get function.
1339 (KJS::globalFuncKJSPrint): Changed to use the new getCString instead of cstring.
1341 * kjs/internal.cpp: Removed printInfo debugging function, a client of cstring.
1342 If we need a debugging function we can easily make a better one and we haven't
1343 used this one in a long time.
1344 * kjs/internal.h: Ditto.
1347 (KJS::JSObject::getPropertyNames): Removed explicit cast to Identifier.
1348 * kjs/property_map.cpp:
1349 (KJS::PropertyMap::getEnumerablePropertyNames): Ditto. Also added a special case for
1350 the case where the propertyNames array is empty -- in that case we know we're adding
1351 a set of names that are non-overlapping so we can use addKnownUnique.
1353 (KJS::UString::getCString): Replaces cstring. Puts the C string into a CStringBuffer,
1354 which is a char Vector with an inline capacity. Also returns a boolean to indicate if
1355 the converion was lossy, which eliminates the need for a separate is8Bit call.
1356 (KJS::UString::toDouble): Changed to call getCString instead of cstring.
1357 * kjs/ustring.h: Ditto.
1359 * wtf/HashFunctions.h: Overload the hash and equal functions for RefPtr's default
1360 hash to take raw pointers. This works with the changes to RefPtrHashMap to avoid
1361 introducing refcount churn.
1363 * wtf/HashMap.h: Removed special code to convert the deleted value to the empty value
1364 when writing a new value into the map. This is now handled elsewhere.
1365 (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1366 HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1369 (WTF::HashTable::isDeletedBucket): Changed to use isDeletedValue instead of using
1370 deletedValue and the equality operator.
1371 (WTF::HashTable::deleteBucket): Changed to use constructDeletedValue instead of
1372 using deletedValue and the assignment operator.
1373 (WTF::HashTable::checkKey): Added. Factors out the check for values that are empty
1374 or deleted keys that's used in various functions below.
1375 (WTF::HashTable::lookup): Changed to use checkKey, check for a 0 table, and also
1376 made public for use by RefPtrHashMap.
1377 (WTF::HashTable::lookupForWriting): Changed to use checkKey.
1378 (WTF::HashTable::fullLookupForWriting): Changed to use checkKey.
1379 (WTF::HashTable::add): Changed to use checkKey, and call initializeBucket on a
1380 deleted bucket before putting a new entry into it.
1381 (WTF::HashTable::addPassingHashCode): Ditto.
1382 (WTF::HashTable::deallocateTable): Check isDeletedBucket before calling ~ValueType.
1384 * wtf/HashTraits.h: Got ridd of all the HashTraits specialization for the integer
1385 types, since GeneicHashTraitsBase already deals with integers separately. Put the
1386 deleted value support into GenericHashTraitsBase. Changed FloatHashTraits to
1387 inherit from GenericHashTraits, and define construct/isDeletedValue rather than
1388 deletedValue. Removed the ref and deref functions from RefPtr's HashTraits, and
1389 defined construct/isDeletedValue. Eliminated DeletedValueAssigner. Changed
1390 PairHashTraits to define construct/isDeletedValue, and also merged
1391 PairBaseHashTraits in with PairHashTraits. Got rid of all specialization of
1392 HashKeyStorageTraits. We'll remove that, and the needsRef data member, later.
1394 * wtf/RefPtr.h: Added HashTableDeletedValueType, an enum type with a single value,
1395 HashTableDeletedValue. Used that type to make a new constructor to construct
1396 deleted values and also added an isHashTableDeletedValue function.
1398 * wtf/RefPtrHashMap.h: Added RefPtrHashMapRawKeyTranslator and used it to implement
1399 the raw pointer functions. This is a way to continue to avoid refcount thrash. We
1400 can't use the old way because it depended on the underlying map using a non-RefPtr
1402 (WTF::HashMap::find): Use find with RefPtrHashMapRawKeyTranslator.
1403 (WTF::HashMap::contains): Use contains with RefPtrHashMapRawKeyTranslator.
1404 (WTF::HashMap::inlineAdd): Use add with RefPtrHashMapRawKeyTranslator.
1405 (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1406 HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1407 (WTF::HashMap::inlineGet): Added. Just like get, but marked inline for use in the
1410 2008-04-25 Sam Weinig <sam@webkit.org>
1412 Rubber-stamped by Mark Rowe.
1414 Remove SavedBuiltins and SavedProperties classes and the methods used to
1415 save data to them. The CachedPage now stores a the JSGlobalObject in full.
1417 * JavaScriptCore.exp:
1418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1419 * JavaScriptCore.xcodeproj/project.pbxproj:
1420 * kjs/JSGlobalObject.cpp:
1421 * kjs/JSGlobalObject.h:
1422 * kjs/JSVariableObject.cpp:
1423 * kjs/JSVariableObject.h:
1424 (KJS::JSVariableObject::localStorage):
1425 * kjs/SavedBuiltins.h: Removed.
1427 * kjs/property_map.cpp:
1428 * kjs/property_map.h:
1430 2008-04-25 Mark Rowe <mrowe@apple.com>
1432 Rubber-stamped by Sam Weinig.
1434 Add some content to an empty ICU header file to prevent verification errors.
1436 * icu/unicode/utf_old.h:
1438 2008-04-25 David Kilzer <ddkilzer@apple.com>
1440 <rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
1442 Patch by George Dicker and Michael Kahl. Reviewed by Darin.
1444 When -[NSObject(WebScriptDebugDelegate) webView:willLeaveCallFrame:sourceId:line:forWebFrame:]
1445 is invoked, the first line number of the function is returned instead of the last
1446 line number. This regressed in r28458.
1449 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
1450 when calling Debugger::returnEvent().
1452 2008-04-25 Darin Adler <darin@apple.com>
1454 Done with Stephanie Lewis.
1456 * JavaScriptCore.xcodeproj/project.pbxproj: Prepare for compilation with gcc 4.2 by
1457 adding -fno-strict-aliasing to CollatorICU.cpp.
1459 2008-04-24 Sam Weinig <sam@webkit.org>
1461 Reviewed by Geoffrey Garen.
1463 Add a #define to easily enable collecting on every allocation to aid
1466 * kjs/collector.cpp:
1467 (KJS::Collector::heapAllocate):
1469 2008-04-24 Kevin McCullough <kmccullough@apple.com>
1471 Reviewed by Adam and Sam.
1473 -<rdar://problem/5770054> JavaScript profiler (10928)
1474 -Only profile the page group that starts profiling to avoid profiling
1475 tools that shouldn't be profiled unless explicitly requested to.
1477 * JavaScriptCore.exp: Export new signature.
1478 * kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject.
1479 (KJS::JSGlobalObject::init):
1480 * kjs/JSGlobalObject.h: Ditto.
1481 (KJS::JSGlobalObject::setPageGroupIdentifier):
1482 (KJS::JSGlobalObject::pageGroupIdentifier):
1483 * profiler/Profiler.cpp: Check the identifier of the page group of the
1484 lexical global exec state and only profile if it matches the given page
1486 (KJS::Profiler::startProfiling):
1487 (KJS::Profiler::willExecute):
1488 (KJS::Profiler::didExecute):
1489 * profiler/Profiler.h: Ditto.
1490 (KJS::Profiler::Profiler):
1492 2008-04-24 Julien Chaffraix <jchaffraix@webkit.org>
1496 Bug 15940: Implement threading API for Qt
1497 https://bugs.webkit.org/show_bug.cgi?id=15940
1499 Original patch by Justin Haygood, tweaked by me.
1501 * JavaScriptCore.pri:
1502 * wtf/ThreadingQt.cpp: Added.
1503 (WTF::threadMapMutex):
1505 (WTF::establishIdentifierForThread):
1506 (WTF::clearThreadForIdentifier):
1507 (WTF::threadForIdentifier):
1508 (WTF::initializeThreading):
1509 (WTF::ThreadPrivate::getReturnValue):
1510 (WTF::ThreadPrivate::ThreadPrivate):
1511 (WTF::ThreadPrivate::run):
1512 (WTF::createThread):
1513 (WTF::waitForThreadCompletion): return !res to return
1514 0 on success (to match the pthreads implementation).
1515 (WTF::detachThread):
1516 (WTF::identifierByQthreadHandle):
1517 (WTF::currentThread):
1518 (WTF::Mutex::Mutex):
1519 (WTF::Mutex::~Mutex):
1521 (WTF::Mutex::tryLock):
1522 (WTF::Mutex::unlock):
1523 (WTF::ThreadCondition::ThreadCondition):
1524 (WTF::ThreadCondition::~ThreadCondition):
1525 (WTF::ThreadCondition::wait):
1526 (WTF::ThreadCondition::timedWait):
1527 (WTF::ThreadCondition::signal):
1529 2008-04-22 Darin Adler <darin@apple.com>
1533 - simplify use of HashTraits to prepare for some upcoming hash table changes
1535 * kjs/SymbolTable.h: Made SymbolTableIndexHashTraits derive from HashTraits<size_t>
1536 and specialize only the empty value.
1538 2008-04-23 Holger Hans Peter Freyther <zecke@selfish.org>
1542 Removed the #define for USE_SYSTEM_MALLOC that we set in WebKit.pri
1547 2008-04-21 Kevin McCullough <kmccullough@apple.com>
1551 <rdar://problem/5770054> JavaScript profiler (10928)
1552 - When stop profiling is called we need to stop the timers on all the
1553 functions that are still running.
1555 * profiler/FunctionCallProfile.cpp:
1556 (KJS::FunctionCallProfile::didExecute):
1557 (KJS::FunctionCallProfile::stopProfiling):
1558 * profiler/FunctionCallProfile.h:
1559 * profiler/Profiler.cpp:
1560 (KJS::Profiler::stopProfiling):
1562 2008-04-21 Alexey Proskuryakov <ap@webkit.org>
1566 Move collector main thread initialization from WebKit/win to KJS::initializeThreading.
1568 * kjs/InitializeThreading.cpp:
1569 (KJS::initializeThreading):
1571 2008-04-21 Adam Roben <aroben@apple.com>
1575 Reviewed by Alexey Proskuryakov.
1578 (KJS::UString::cost): Disable a warning about assigning a 32-bit
1579 size_t into a 31-bit size_t.
1581 2008-04-21 Simon Hausmann <hausmann@webkit.org>
1585 Made convertValueToQVariant accessible from within WebKit/qt/Api
1587 * bindings/qt/qt_runtime.h:
1589 2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
1593 Build fix for Qt 4.3
1595 * When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is
1596 always defined. Do this by adding defines to the compiler line
1597 * For users of our API this is not feasible. Every public header file should
1598 include qwebkitglobal.h. Define the QT_BEGIN_NAMESPACE and QT_END_NAMESPACE
1599 when we are building everything < 4.4.0 and don't have them defined.
1603 2008-04-19 Matt Lilek <webkit@mattlilek.com>
1605 Not reviewed, Windows build fix - copy the profiler headers in all
1606 configurations, not just Debug_Internal.
1608 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1610 2008-04-19 Mike Hommey <glandium@debian.org>
1612 Reviewed by Alp Toker.
1614 Don't build testkjs with rpath.
1618 2008-04-18 Kevin Ollivier <kevino@theolliviers.com>
1620 wx build fixes. Rename LocalStorage.h to LocalStorageEntry.h
1621 to avoid header detection issues between WebCore/storage/LocalStorage.h
1622 and it, and add $(PROFILER_SOURCES) to the wx JSCore build.
1624 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1625 * JavaScriptCore.xcodeproj/project.pbxproj:
1628 * kjs/JSVariableObject.h:
1629 * kjs/LocalStorage.h: Removed.
1630 * kjs/LocalStorageEntry.h: Copied from JavaScriptCore/kjs/LocalStorage.h.
1633 2008-04-18 Jan Michael Alonzo <jmalonzo@unpluggable.com>
1635 Reviewed by Alp Toker.
1637 http://bugs.webkit.org/show_bug.cgi?id=16620
1638 [GTK] Autotools make dist and make check support
1644 2008-04-18 Jon Honeycutt <jhoneycutt@apple.com>
1646 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Windows
1649 2008-04-11 Mark Rowe <mrowe@apple.com>
1651 Rubber-stamped by Antti Koivisto.
1653 Silence GCC 4.3 warnings by removing extraneous consts.
1658 2008-04-18 Kevin McCullough <kmccullough@apple.com>
1662 -<rdar://problem/5770054> JavaScript profiler (10928)
1663 - Use Deque instead of Vector since the profiler uses prepend a lot
1664 and deque is faster at that.
1666 * profiler/FunctionCallProfile.h:
1667 (KJS::FunctionCallProfile::milliSecs): Corrected the name to match
1670 (WTF::deleteAllValues):
1672 2008-04-18 Kevin McCullough <kmccullough@apple.com>
1674 Reviewed by Sam and Adam.
1676 -<rdar://problem/5770054> JavaScript profiler (10928)
1677 - Cleaned up the header file and made some functions static, added
1678 a new, sane, printing function, and fixed a few minor bugs.
1680 * JavaScriptCore.exp:
1681 * JavaScriptCore.xcodeproj/project.pbxproj:
1682 * profiler/FunctionCallProfile.cpp:
1683 (KJS::FunctionCallProfile::didExecute): Removed assertion that time is
1684 > 0 because at ms resolution that may not be true and only cross-
1685 platform way to get time differences is in ms.
1686 (KJS::FunctionCallProfile::printDataInspectorStyle): Added a new
1687 printing function for dumping data in a sane style.
1688 (KJS::FunctionCallProfile::printDataSampleStyle): Fixed a bug where we
1689 displayed too much precision when printing our floats. Also added logic
1690 to make sure we don't display 0 because that doesn't make sense for a
1692 * profiler/FunctionCallProfile.h:
1693 * profiler/Profiler.cpp: Moved functions that could be static into the
1694 implementation, and chaned the ASSERTs to early returns. I did this
1695 because console.profile() is a JS function and so was being profiled
1696 but asserting because the profiler had not been started! In the future
1697 I would like to put the ASSERTs back and not profile the calls to
1698 console.profile() and console.profileEnd().
1699 (KJS::Profiler::willExecute):
1700 (KJS::Profiler::didExecute):
1701 (KJS::getStackNames): Fixed a bug where the wrong ExecState was being
1703 (KJS::getFunctionName):
1704 (KJS::Profiler::printDataInspectorStyle):
1705 * profiler/Profiler.h:
1707 2008-04-18 Alexey Proskuryakov <ap@webkit.org>
1711 Fix leaks during plugin tests (which actually excercise background JS), and potential
1712 PAC brokenness that was not reported, but very likely.
1714 The leaks shadowed a bigger problem with Identifier destruction. Identifier::remove involves
1715 an IdentifierTable lookup, which is now a per-thread instance. Since garbage collection can
1716 currently happen on a different thread than allocation, a wrong table was used.
1718 No measurable change on SunSpider total, ~1% variation on individual tests.
1722 (KJS::UString::Rep::create):
1723 (KJS::UString::Rep::destroy):
1725 Replaced isIdentifier with a pointer to IdentifierTable, so that destruction can be done
1726 correctly. Took one bit from reportedCost, to avoid making UString::Rep larger (performance
1727 effect was measurable on SunSpider).
1729 * kjs/identifier.cpp:
1730 (KJS::IdentifierTable::IdentifierTable):
1731 (KJS::IdentifierTable::~IdentifierTable):
1732 (KJS::IdentifierTable::add):
1733 (KJS::IdentifierTable::remove):
1734 Make IdentifierTable a real class. Its destructor needs to zero out outstanding references,
1735 because some identifiers may briefly outlive it during thread destruction, and we don't want
1736 them to use their stale pointers.
1738 (KJS::LiteralIdentifierTable):
1739 (KJS::Identifier::add):
1740 Now that LiteralIdentifierTable is per-thread and can be destroyed not just during application
1741 shutdown, it is not appropriate to simply bump refcount for strings that get there; changed
1742 the table to hold RefPtrs.
1744 (KJS::CStringTranslator::translate):
1745 (KJS::UCharBufferTranslator::translate):
1746 (KJS::Identifier::addSlowCase):
1747 (KJS::Identifier::remove):
1749 (KJS::Identifier::add):
1750 Use and update UString::Rep::identifierTable as appropriate. Updating it is now done in
1751 IdentifierTable::add, not in translators.
1753 2008-04-18 Alexey Proskuryakov <ap@webkit.org>
1757 Get rid of static compareWithCompareFunctionArguments in array_instance.cpp.
1759 No change on SunSpider, CelticKane or iBench JavaScript. It is probable that in some cases,
1760 merge sort is still faster, but more investigation is needed to determine a new cutoff.
1761 Or possibly, it would be better to do what FIXME says (change to tree sort).
1763 Also, made arguments a local variable - not sure why it was a member of
1764 CompareWithCompareFunctionArguments.
1766 * kjs/array_instance.cpp:
1767 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1768 (KJS::CompareWithCompareFunctionArguments::operator()):
1769 (KJS::ArrayInstance::sort):
1771 2008-04-18 Simon Hausmann <hausmann@webkit.org>
1773 Build fix for gcc 4.3. Include stdio.h for printf.
1775 * profiler/FunctionCallProfile.cpp:
1776 * profiler/Profiler.cpp:
1778 2008-04-17 Jon Honeycutt <jhoneycutt@apple.com>
1782 * wtf/Platform.h: Add HAVE_ACCESSIBILITY to Platform.h.
1784 2008-04-17 Alexey Proskuryakov <ap@webkit.org>
1788 Thread static data destructors are not guaranteed to be called in any particular order;
1789 turn ThreadSpecific into a phoenix-style singleton to avoid accessing freed memory when
1790 deleted objects are interdependent (e.g. CommonIdentifiers and internal identifier tables).
1792 No change on SunSpider.
1794 * wtf/ThreadSpecific.h:
1795 (WTF::ThreadSpecific::Data::Data):
1800 2008-04-15 Srinivas Rao. M Hamse <msrinirao@gmail.com>
1802 Reviewed by Maciej Stachowiak.
1806 * kjs/nodes.h: CallerType definition made public for gcc 3.x compilation
1808 2008-04-16 Brady Eidson <beidson@apple.com>
1810 Reviewed by Sam Weinig
1812 Change ThreadSafeShared to act like RefCounted by starting out with a single ref by default
1815 (WTF::ThreadSafeShared::ThreadSafeShared):
1817 2008-04-16 Sam Weinig <sam@webkit.org>
1819 Reviewed by Geoffrey Garen.
1821 - To keep the behavior of the WebKit and JavaScriptCore API's the same,
1822 we need to hide the fact that the global object and the window object
1823 are no longer the same thing, and the the global object now changes on
1824 navigations. To do this, only the wrapper should ever be exposed. This
1825 fixes the two remaining spots where the internal global object is exposed,
1826 the windowScriptObject returned from [WebFrame windowObject] and the object
1827 return by calling JSContextGetGlobalObject on [WebFrame globalContext].
1829 * API/JSContextRef.cpp:
1830 (JSContextGetGlobalObject):
1831 This is a bit of a hack, this returns the "this" representation of the globalObject
1832 which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
1834 * API/JSObjectRef.cpp:
1835 (JSObjectSetProperty):
1836 Call the new putWithAttributes method instead of relying on lower-level calls.
1837 This is needed so that the window wrapper can forward the calls.
1839 * JavaScriptCore.exp:
1841 * kjs/JSGlobalObject.cpp:
1842 (KJS::JSGlobalObject::putWithAttributes):
1843 * kjs/JSGlobalObject.h:
1844 * kjs/JSVariableObject.h:
1845 (KJS::JSVariableObject::symbolTablePutWithAttributes):
1847 (KJS::ActivationImp::putWithAttributes):
1849 (KJS::ConstDeclNode::handleSlowCase):
1850 (KJS::ConstDeclNode::evaluateSingle):
1851 (KJS::EvalNode::processDeclarations):
1853 (KJS::JSObject::putWithAttributes):
1855 Rename initializeVariable to putWithAttributes and move it down to JSObject so it
1856 can be used for JSObjectSetProperty.
1858 2008-04-16 Kevin McCullough <kmccullough@apple.com>
1860 Reviewed by Sam and Geoff.
1862 -<rdar://problem/5770054> JavaScript profiler (10928)
1863 Inital profiler prototype
1865 * GNUmakefile.am: Added new files to project
1866 * JavaScriptCore.pri: Ditto
1867 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
1868 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto
1869 * JavaScriptCoreSources.bkl: Ditto
1870 * kjs/config.h: Put compiling flag in here.
1871 * kjs/function.cpp: Instrument calling the function eval().
1873 * kjs/interpreter.cpp: Instrument evaluating global scopes.
1874 (KJS::Interpreter::evaluate):
1875 * kjs/object.cpp: Instrument JS function calls.
1876 (KJS::JSObject::call):
1878 * profiler/FunctionCallProfile.cpp: Added.
1879 (KJS::FunctionCallProfile::FunctionCallProfile):
1880 (KJS::FunctionCallProfile::~FunctionCallProfile):
1881 (KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer.
1882 (KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer.
1883 (KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile.
1884 (KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one.
1885 (KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
1886 * profiler/FunctionCallProfile.h: Added.
1887 (KJS::FunctionCallProfile::FunctionCallProfile):
1888 (KJS::FunctionCallProfile::~FunctionCallProfile):
1889 (KJS::FunctionCallProfile::functionName):
1890 (KJS::FunctionCallProfile::microSecs):
1891 * profiler/Profiler.cpp: Added.
1892 (KJS::Profiler::profiler):
1893 (KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns)
1894 (KJS::Profiler::startProfiling): Don't start collecting profiling information until the user starts the profiler. Also don't clear old prfiled data until the profiler is restarted.
1895 (KJS::Profiler::stopProfiling): Stop collecting profile information.
1896 (KJS::Profiler::willExecute): Same as above.
1897 (KJS::Profiler::didExecute): Same as above.
1898 (KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it.
1899 (KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack.
1900 (KJS::Profiler::getFunctionName): Get the function name from the given parameter.
1901 (KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
1902 (KJS::Profiler::debugLog):
1903 * profiler/Profiler.h: Added.
1904 (KJS::Profiler::Profiler):
1906 2008-04-16 Sam Weinig <sam@webkit.org>
1908 Reviewed by Darin Adler.
1910 - Remove kjs_ prefix from strtod, dtoa, and freedtoa and put it
1911 in the KJS namespace.
1912 - Make strtod, dtoa, and freedtoa c++ functions instead of extern "C".
1913 - Remove mode switching from dtoa. ~2% improvement on test 26.
1914 - Removes all unnecessary #defines from dtoa code.
1916 * JavaScriptCore.exp:
1931 * kjs/number_object.cpp:
1932 (KJS::integer_part_noexp):
1933 (KJS::numberProtoFuncToExponential):
1935 (KJS::UString::from):
1936 (KJS::UString::toDouble):
1938 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1942 Get rid of static execForCompareByStringForQSort in array_instance.cpp.
1944 No change on SunSpider, CelticKane or iBench JavaScript.
1946 * kjs/array_instance.cpp:
1947 (KJS::ArraySortComparator::ArraySortComparator):
1948 (KJS::ArraySortComparator::operator()):
1949 (KJS::ArrayInstance::sort):
1950 Switch slow case to std::sort, so that ExecState can be passed in a comparator.
1952 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1954 Reviewed by Adam Roben.
1958 * kjs/CommonIdentifiers.cpp:
1959 * kjs/CommonIdentifiers.h:
1962 * kjs/identifier.cpp:
1964 * wtf/ThreadSpecific.h:
1966 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1970 * kjs/date_object.cpp:
1971 * kjs/date_object.h:
1972 Don't include DateMath.h from date_object.h, as the latter is used from WebCore, while
1973 where the former is not available.
1975 2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
1977 Unreviewed build fix for MSVC. It does not want to have
1978 WTF in the KJS namespace.
1980 * kjs/CommonIdentifiers.h:
1982 2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
1984 Unreviewed build fix for gcc.
1986 ::msToGregorianDateTime is not known to it.
1988 * kjs/date_object.cpp:
1989 (KJS::DateInstance::msToGregorianDateTime):
1991 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1993 Reviewed by Oliver Hunt.
1995 Initialize threadMapMutex safely (as already done in ThreadingWin).
1997 * wtf/ThreadingGtk.cpp:
1998 (WTF::threadMapMutex):
1999 (WTF::initializeThreading):
2000 * wtf/ThreadingPthreads.cpp:
2001 (WTF::threadMapMutex):
2002 (WTF::initializeThreading):
2004 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2006 Reviewed by Adam Roben.
2008 Cache Gregorian date/time structure on DateInstance objects for 1.027x SunSpider speedup
2009 (1.65x on date-format-xparb, 1.13x on date-format-tofte).
2012 (KJS::GregorianDateTime::copyFrom): Added. It presumably makes sense to keep GregorianDateTime
2013 Noncopyable, so it's not just operator=.
2015 * kjs/date_object.h: Added a per-object cache.
2017 * kjs/date_object.cpp:
2018 (KJS::DateInstance::DateInstance):
2019 (KJS::DateInstance::msToGregorianDateTime):
2020 (KJS::dateProtoFuncToString):
2021 (KJS::dateProtoFuncToUTCString):
2022 (KJS::dateProtoFuncToDateString):
2023 (KJS::dateProtoFuncToTimeString):
2024 (KJS::dateProtoFuncToLocaleString):
2025 (KJS::dateProtoFuncToLocaleDateString):
2026 (KJS::dateProtoFuncToLocaleTimeString):
2027 (KJS::dateProtoFuncGetFullYear):
2028 (KJS::dateProtoFuncGetUTCFullYear):
2029 (KJS::dateProtoFuncToGMTString):
2030 (KJS::dateProtoFuncGetMonth):
2031 (KJS::dateProtoFuncGetUTCMonth):
2032 (KJS::dateProtoFuncGetDate):
2033 (KJS::dateProtoFuncGetUTCDate):
2034 (KJS::dateProtoFuncGetDay):
2035 (KJS::dateProtoFuncGetUTCDay):
2036 (KJS::dateProtoFuncGetHours):
2037 (KJS::dateProtoFuncGetUTCHours):
2038 (KJS::dateProtoFuncGetMinutes):
2039 (KJS::dateProtoFuncGetUTCMinutes):
2040 (KJS::dateProtoFuncGetSeconds):
2041 (KJS::dateProtoFuncGetUTCSeconds):
2042 (KJS::dateProtoFuncGetTimezoneOffset):
2043 (KJS::setNewValueFromTimeArgs):
2044 (KJS::setNewValueFromDateArgs):
2045 (KJS::dateProtoFuncSetYear):
2046 (KJS::dateProtoFuncGetYear):
2047 Use the cache when converting.
2049 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2053 Implement an abstraction for thread-specific storage, use it to get rid of some static objects.
2055 SunSpider results were not conclusive, possibly up to 0.2% slowdown.
2057 * JavaScriptCore.xcodeproj/project.pbxproj:
2058 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2059 Added ThreadSpecific.h
2061 * wtf/ThreadSpecific.h: Added.
2062 (WTF::::ThreadSpecific):
2063 (WTF::::~ThreadSpecific):
2069 Only implemented for platforms that use pthreads.
2071 * kjs/CommonIdentifiers.cpp:
2072 (KJS::CommonIdentifiers::shared):
2073 * kjs/CommonIdentifiers.h:
2074 * kjs/InitializeThreading.cpp:
2075 (KJS::initializeThreading):
2079 * kjs/identifier.cpp:
2080 (KJS::identifierTable):
2081 (KJS::literalIdentifierTable):
2082 (KJS::Identifier::initializeIdentifierThreading):
2087 Make static instances per-thread.
2089 2008-04-15 Anders Carlsson <andersca@apple.com>
2093 Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
2095 * Configurations/JavaScriptCore.xcconfig:
2097 2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
2101 Fix compilation with Qt namespaces
2103 Qt can be configured to have all of its classes inside a specified namespaces.
2104 This is for example used in plugin/component environments like Eclipse.
2106 This change makes it possible to let the Qt port compile against a namespaced
2107 Qt by the use of macros Qt provides to properly forward declare Qt classes in
2110 * wtf/unicode/qt4/UnicodeQt4.h:
2112 2008-04-14 Anders Carlsson <andersca@apple.com>
2116 Don't leak the prototype class.
2118 * API/JSClassRef.cpp:
2119 (OpaqueJSClass::create):
2121 2008-04-14 Steve Falkenburg <sfalken@apple.com>
2125 * wtf/ThreadingWin.cpp:
2127 2008-04-14 Alexey Proskuryakov <ap@webkit.org>
2129 Reviewed by Adam Roben.
2131 https://bugs.webkit.org/show_bug.cgi?id=18488
2132 FastMalloc doesn't release thread-specific data on Windows
2134 * wtf/ThreadingWin.cpp:
2135 (WTF::threadMapMutex): (WTF::initializeThreading): Call threadMapMutex once to initialize the static safely.
2136 (WTF::ThreadFunctionInvocation::ThreadFunctionInvocation): Added a structure to wrap thread entry point and arguments.
2137 (WTF::wtfThreadEntryPoint): Make sure to end all WTF threads with pthread_exit(), to give pthreads-win32 a chance to call
2138 destructors of thread-specific data.
2139 (WTF::createThread): Use _beginthreadex instead of CreateThread, because MSDN says so. Also removed a call to CreateEvent,
2140 for which I could see no reason at all.
2142 2008-04-14 Alexey Proskuryakov <ap@webkit.org>
2144 Touched a file to make JavaScriptCore.vcproj rebuild.
2148 2008-04-14 Adam Roben <aroben@apple.com>
2152 Rubberstamped by Alexey Proskuryakov.
2154 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
2155 the "potentially uninitialized variable" warning for grammar.cpp, as
2156 it seems to be incorrect. yylval gets initialized by the lexer, but
2157 MSVC doesn't seem to understand this.
2159 2008-04-11 Antti Koivisto <antti@apple.com>
2163 Add default hash for pairs of hashable types.
2165 * wtf/HashFunctions.h:
2166 (WTF::PairHash::hash):
2167 (WTF::PairHash::equal):
2170 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2174 Make DateMath.cpp thread safe.
2176 No measurable change on SunSpider (should be a very small speedup).
2179 (KJS::mimimumYearForDST): (KJS::equivalentYearForDST): Got rid of double caching of the
2180 same precomputed value.
2181 (KJS::calculateUTCOffset): (KJS::getUTCOffset): Factored actual UTC offset calculation code
2182 out of getUTCOffset(), and notification setup into initDateMath().
2184 (KJS::initDateMath): Added.
2187 * kjs/InitializeThreading.cpp:
2188 (KJS::initializeThreading):
2189 Added initDateMath().
2191 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2197 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2199 Tiger build fix. Forward declaring a union didn't work for whatever reason, make the
2208 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2212 Generate a pure (re-entrant) parser with Bison.
2214 No change on SunSpider.
2217 (KJS::Parser::parse):
2223 Pass state as function arguments, instead of global data. Don't call lexer() as often as
2224 before, as this function is about to become slower due to thread-specific storage.
2227 (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are
2228 already taken care of. This is a small speedup, compensating for a small slowdown caused
2229 by switching Bison mode.
2231 2008-04-10 Alexey Proskuryakov <ap@webkit.org>
2235 https://bugs.webkit.org/show_bug.cgi?id=18402
2236 REGRESSION: visited element handling is incorrect in nested join/toString calls
2238 No change on SunSpider total, possibly a tiny improvement (about 0.1%).
2240 Test: fast/js/array-tostring-and-join.html
2242 * kjs/JSGlobalObject.h:
2243 (KJS::JSGlobalObject::visitedElements): Store visited elements HashSet here, making it
2244 common to toString/toLocalizedString/join again.
2246 * kjs/array_object.cpp:
2247 (KJS::arrayProtoFuncToString):
2248 (KJS::arrayProtoFuncToLocaleString):
2249 (KJS::arrayProtoFuncJoin):
2250 Got rid of static variables. Replaced UString with Vector to avoid O(n^2) behavior and
2256 (WTF::::reserveCapacity):
2259 Added null checks, so that Vector methods don't crash when out of memory. The caller should
2260 check that data pointer is not null before proceeding.
2262 2008-04-10 Mark Rowe <mrowe@apple.com>
2264 Reviewed by Maciej Stachowiak.
2266 Fix https://bugs.webkit.org/show_bug.cgi?id=18367 and the many dupes.
2267 Bug 18367: Crash during celtic kane js speed 2007 test
2269 GCC 4.2 on x86_64 Linux decided to reorder the local variables in markCurrentThreadConservatively's
2270 stack frame. This lead to the range of addresses the collector treated as stack to exclude the
2271 contents of volatile registers that markCurrentThreadConservatively forces onto the stack. This was
2272 leading to objects being prematurely collected if the only reference to them was via a register at
2273 the time a collection occurred.
2275 The fix for this is to move the calculation of the top of the stack into a NEVER_INLINE function
2276 that is called from markCurrentThreadConservatively. This forces the dummy variable we use for
2277 determining the top of stack to be in a different stack frame which prevents the compiler from
2278 reordering it relative to the registers that markCurrentThreadConservatively forces onto the stack.
2280 * kjs/collector.cpp:
2281 (KJS::Collector::markCurrentThreadConservativelyInternal):
2282 (KJS::Collector::markCurrentThreadConservatively):
2285 2008-04-10 Adam Roben <aroben@apple.com>
2287 VC++ Express build fix
2289 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Link against user32.lib so
2290 that anyone who links against WTF.lib will get user32.lib
2293 2008-04-09 Adam Roben <aroben@apple.com>
2295 VC++ Express build fix
2297 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
2300 2008-04-09 Adam Roben <aroben@apple.com>
2304 * JavaScriptCore.exp: Export isMainThread.
2306 2008-04-09 Adam Roben <aroben@apple.com>
2310 * wtf/AlwaysInline.h: Make sure to #include Platform.h before using
2311 the macros it defines.
2313 2008-04-08 Mark Rowe <mrowe@apple.com>
2315 Export WTF::initializeThreading() from JavaScriptCore.
2317 * JavaScriptCore.exp:
2319 2008-04-04 Sam Weinig <sam@webkit.org>
2321 Reviewed by Geoffrey Garen.
2323 First step in implementing the "split window"
2325 - Add a GlobalThisValue to ExecState which should be used
2326 in places that used to implement the "use the global object
2327 as this if null" rule.
2328 - Factor out lookupGetter/lookupSetter into virtual methods
2329 on JSObject so that they can be forwarded.
2330 - Make defineGetter/defineSetter virtual methods for the same
2332 - Have PrototypeReflexiveFunction store the globalObject used
2333 to create it so that it can be used to get the correct thisObject
2336 * API/JSObjectRef.cpp:
2337 (JSObjectCallAsFunction):
2338 * JavaScriptCore.exp:
2340 * kjs/ExecState.cpp:
2341 (KJS::ExecState::ExecState):
2342 (KJS::GlobalExecState::GlobalExecState):
2344 (KJS::ExecState::globalThisValue):
2345 * kjs/ExecStateInlines.h:
2346 (KJS::ExecState::ExecState):
2347 (KJS::FunctionExecState::FunctionExecState):
2348 * kjs/JSGlobalObject.cpp:
2349 (KJS::JSGlobalObject::reset):
2350 (KJS::JSGlobalObject::toGlobalObject):
2351 * kjs/JSGlobalObject.h:
2352 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
2353 (KJS::JSGlobalObject::JSGlobalObject):
2354 * kjs/array_instance.cpp:
2355 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2356 (KJS::compareWithCompareFunctionForQSort):
2357 * kjs/array_object.cpp:
2358 (KJS::arrayProtoFuncSort):
2359 (KJS::arrayProtoFuncFilter):
2360 (KJS::arrayProtoFuncMap):
2361 (KJS::arrayProtoFuncEvery):
2362 (KJS::arrayProtoFuncForEach):
2363 (KJS::arrayProtoFuncSome):
2365 (KJS::FunctionImp::callAsFunction):
2366 (KJS::ActivationImp::toThisObject):
2367 (KJS::globalFuncEval):
2368 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
2369 (KJS::PrototypeReflexiveFunction::mark):
2371 (KJS::PrototypeReflexiveFunction::cachedGlobalObject):
2372 * kjs/function_object.cpp:
2373 (KJS::functionProtoFuncApply):
2374 (KJS::functionProtoFuncCall):
2376 (KJS::ExpressionNode::resolveAndCall):
2377 (KJS::FunctionCallValueNode::evaluate):
2378 (KJS::LocalVarFunctionCallNode::inlineEvaluate):
2379 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
2380 (KJS::FunctionCallBracketNode::evaluate):
2381 (KJS::FunctionCallDotNode::inlineEvaluate):
2383 (KJS::JSObject::call):
2384 (KJS::JSObject::put):
2385 (KJS::tryGetAndCallProperty):
2386 (KJS::JSObject::lookupGetter):
2387 (KJS::JSObject::lookupSetter):
2388 (KJS::JSObject::toThisObject):
2389 (KJS::JSObject::toGlobalObject):
2390 (KJS::JSObject::fillGetterPropertySlot):
2392 * kjs/object_object.cpp:
2393 (KJS::objectProtoFuncLookupGetter):
2394 (KJS::objectProtoFuncLookupSetter):
2395 * kjs/string_object.cpp:
2398 2008-04-08 Brady Eidson <beidson@apple.com>
2400 Encourage Windows to rebuild - AGAIN...
2404 2008-04-08 Adam Roben <aroben@apple.com>
2408 * JavaScriptCore.exp: Add callOnMainThread, and sorted the list.
2410 2008-04-08 Brady Eidson <beidson@apple.com>
2412 Rubberstamped by Adam Roben
2414 Touch some files to *strongly* encourage Windows to rebuilt with DOM_STORAGE enabled
2418 2008-04-08 Adam Roben <aroben@apple.com>
2420 Move callOnMainThread to WTF
2422 Reviewed by Alexey Proskuryakov.
2425 * JavaScriptCore.pri:
2426 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2427 * JavaScriptCore.xcodeproj/project.pbxproj:
2428 * JavaScriptCoreSources.bkl:
2431 * wtf/MainThread.cpp:
2433 * wtf/gtk/MainThreadGtk.cpp:
2434 * wtf/mac/MainThreadMac.mm:
2435 * wtf/qt/MainThreadQt.cpp:
2436 * wtf/win/MainThreadWin.cpp:
2437 * wtf/wx/MainThreadWx.cpp:
2438 Moved here from WebCore/platform. Replaced all instances of "WebCore"
2441 * kjs/bool_object.cpp: Touched to force JavaScriptCore.vcproj to
2443 to the WTF namespace.
2444 * wtf/ThreadingWin.cpp:
2445 (WTF::initializeThreading): Call initializeMainThread.
2447 2008-04-07 Brady Eidson <beidson@apple.com>
2449 Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
2451 * Configurations/JavaScriptCore.xcconfig:
2453 2008-04-07 Adam Roben <aroben@apple.com>
2457 * wtf/ThreadingWin.cpp: Back out some changes I didn't mean to land.
2459 2008-04-07 Adam Roben <aroben@apple.com>
2461 Add WTF::isMainThread
2463 Reviewed by Alexey Proskuryakov.
2465 * wtf/Threading.h: Declare the new function.
2466 * wtf/ThreadingGtk.cpp:
2467 (WTF::initializeThreading): Initialize the main thread identifier.
2468 (WTF::isMainThread): Added.
2469 * wtf/ThreadingNone.cpp: Ditto ThreadingGtk.cpp.
2470 (WTF::initializeThreading):
2471 (WTF::isMainThread):
2472 * wtf/ThreadingPthreads.cpp: Ditto.
2473 (WTF::initializeThreading):
2474 (WTF::isMainThread):
2475 * wtf/ThreadingWin.cpp: Ditto.
2476 (WTF::initializeThreading):
2477 (WTF::isMainThread):
2479 2008-04-06 Alexey Proskuryakov <ap@webkit.org>
2483 Make UString thread-safe.
2485 No change on SunSpider total, although individual tests have changed a lot, up to 3%.
2487 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Call UString::null() to initialize
2490 * kjs/identifier.cpp:
2491 (KJS::CStringTranslator::translate):
2492 (KJS::UCharBufferTranslator::translate):
2493 Use "true" for a boolean value instead of 1, because it's C++.
2496 (KJS::CString::adopt): Added a method to create from a char* buffer without copying.
2497 (KJS::UString::Rep::ref): Removed an assertion for JSLock::lockCount, as it's no longer
2498 necessary to hold JSLock when working with strings.
2499 (KJS::UString::Rep::deref): Ditto.
2500 (KJS::UString::Rep::isStatic): Added a field to quickly determine that this is an empty
2501 or null static string.
2504 (KJS::): Removed normalStatBufferSize and statBufferSize, as there is no reason to have such
2505 an advanced implementation of a debug-only ascii() method. Removed a long-obsolete comment
2507 (KJS::UString::Rep::createCopying): Removed an assertion for JSLock::lockCount.
2508 (KJS::UString::Rep::create): Ditto.
2509 (KJS::UString::Rep::destroy): Ditto. Do not do anything for static null and empty strings,
2510 as refcounting is not reliable for those. Reordered branches for a noticeable speed gain -
2511 apparently this functiton is hot enough for SunSpider to see an effect from this!
2512 (KJS::UString::null): Moved a star, added a comment.
2513 (KJS::UString::cstring): Reimplemented to not call ascii(), which is not thread-safe.
2514 (KJS::UString::ascii): Simplified statBuffer handling logic.
2515 (KJS::UString::toDouble): Use cstring() instead of ascii().
2517 2008-04-02 Mark Rowe <mrowe@apple.com>
2519 Reviewed by Oliver Hunt.
2521 Ensure that debug symbols are generated for x86_64 and ppc64 builds.
2523 * Configurations/Base.xcconfig:
2525 2008-04-01 Christian Dywan <christian@imendio.com>
2527 Build fix for GCC 4.3.
2529 * wtf/unicode/icu/CollatorICU.cpp: include string.h
2531 2008-04-01 Alexey Proskuryakov <ap@webkit.org>
2533 Rubber-stamped by Darin.
2535 Turn off using 64-bit arithmetic on 32-bit hardware, as dtoa own code is faster than
2536 compiler-provided emulation.
2538 1% speedup on Acid3 test 26.
2542 2008-04-01 Alexey Proskuryakov <ap@webkit.org>
2546 Make MathExtras.h thread safe.
2548 * kjs/math_object.cpp:
2549 (KJS::mathProtoFuncRandom): If threading is enabled, rely on initializeThreading to call
2553 * wtf/ThreadingGtk.cpp:
2554 (WTF::initializeThreading):
2555 * wtf/ThreadingNone.cpp:
2556 (WTF::initializeThreading):
2557 * wtf/ThreadingPthreads.cpp:
2558 (WTF::initializeThreading):
2559 * wtf/ThreadingWin.cpp:
2560 (WTF::initializeThreading):
2561 Call wtf_random_init(); made the function non-inline to avoid having to include too many
2562 headers in Threading.h.
2564 2008-03-31 Eric Seidel <eric@webkit.org>
2568 Make matching of regexps using ^ much faster
2569 http://bugs.webkit.org/show_bug.cgi?id=18086
2571 * pcre/pcre_compile.cpp:
2573 (branchNeedsLineStart):
2574 * pcre/pcre_exec.cpp:
2577 * pcre/pcre_internal.h:
2579 2008-03-29 Alexey Proskuryakov <ap@webkit.org>
2581 Reviewed by Oliver Hunt.
2583 <rdar://problem/5829556> REGRESSION: Leak in KJS::initializeThreading()
2585 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): There is no guarantee that
2586 initializeThreading() is called only once; check that the mutex hasn't been already allocated.
2588 2008-03-29 Oliver Hunt <oliver@apple.com>
2592 Bug 17924: Crash in KJS::ConstDeclNode::evaluate with |with| and |const|
2593 <http://bugs.webkit.org/show_bug.cgi?id=17924>
2594 <rdar://problem/5806933>
2596 It turns out this is trivially avoidable if we just match firefox's
2597 semantics and ensure that an assignment in a const declaration always
2598 writes to the variable object.
2601 (KJS::ConstDeclNode::handleSlowCase):
2603 2008-03-28 Alexey Proskuryakov <ap@webkit.org>
2605 Reviewed by Sam Weinig.
2607 Fix a dtoa thread safety issue.
2609 WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety
2610 compiled in for dtoa.
2612 This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with
2613 his recent improvement.
2618 Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was
2619 in the presence of locking (but somewhat slower in single-threaded case).
2620 (Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to
2621 restructure the code to avoid significant performance implications).
2622 (Bigint::lshift): Rewrote to avoid an allocation, if possible.
2625 (Bigint::kjs_freedtoa):
2627 Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS.
2629 * kjs/InitializeThreading.cpp: Added.
2630 (KJS::initializeThreading):
2631 * kjs/InitializeThreading.h: Added.
2632 Initialize threading at KJS level, if enabled.
2634 * kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading.
2636 * kjs/testkjs.cpp: (kjsmain): Call initializeThreading.
2638 * JavaScriptCore.exp: Export KJS::initializeThreading.
2641 * JavaScriptCore.exp:
2642 * JavaScriptCore.pri:
2643 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2644 * JavaScriptCoreSources.bkl:
2645 * JavaScriptCore.xcodeproj/project.pbxproj:
2646 Added InitializeThreading.{h,cpp}.
2648 * wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only
2649 to be called from KJS::initializeThreading, and having it in the global namespace is useless.
2651 2008-03-28 Brady Eidson <beidson@apple.com>
2655 Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore
2657 * JavaScriptCore.exp:
2658 * JavaScriptCore.xcodeproj/project.pbxproj:
2660 2008-03-27 Darin Adler <darin@apple.com>
2662 Reviewed by Mark Rowe.
2664 <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
2665 compiled length calculated incorrectly.
2667 * pcre/pcre_compile.cpp:
2668 (multiplyWithOverflowCheck):
2669 (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
2670 and bail with an error rather than returning incorrect results.
2672 2008-03-26 Mark Rowe <mrowe@apple.com>
2674 Rubber-stamped by Brady Eidson.
2676 Update FEATURE_DEFINES to be consistent with the other locations in which it is defined.
2678 * Configurations/JavaScriptCore.xcconfig:
2680 2008-03-26 Adam Roben <aroben@apple.com>
2682 Fix Bug 18060: Assertion failure (JSLock not held) beneath
2683 JSCallbackObject<Base>::toString
2685 <http://bugs.webkit.org/show_bug.cgi?id=18060>
2687 Reviewed by Geoff Garen.
2691 * API/JSCallbackObjectFunctions.h:
2692 (KJS::JSCallbackObject<Base>::toString): Make the DropAllLocks
2693 instance only be in scope while calling convertToType.
2698 (MyObject_convertToType): Implement type conversion to string.
2699 * API/testapi.js: Add a test for type conversion to string.
2701 2008-03-26 Adam Roben <aroben@apple.com>
2705 * kjs/array_instance.cpp: Touched this.
2706 * wtf/HashFunctions.h:
2707 (WTF::intHash): Added 8- and 16-bit versions of intHash.
2709 2008-03-26 Adam Roben <aroben@apple.com>
2711 Force JSC headers to be copied by touching a file
2713 * kjs/array_instance.cpp:
2714 (KJS::ArrayInstance::getPropertyNames):
2716 2008-03-26 Adam Roben <aroben@apple.com>
2718 Windows build fix after r31324
2722 Added HashTable plumbing to support using wchar_t as a key type.
2724 * wtf/HashFunctions.h:
2728 2008-03-26 Maciej Stachowiak <mjs@apple.com>
2732 - JSC part of fix for "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)"
2733 http://bugs.webkit.org/show_bug.cgi?id=18118
2735 * wtf/HashFunctions.h:
2740 2008-03-26 Alexey Proskuryakov <ap@webkit.org>
2744 Cache C string identifiers by address, not value, assuming that C strings can only
2747 1% speedup on Acid3 test 26.
2749 * kjs/identifier.cpp:
2750 (KJS::literalIdentifierTable):
2751 (KJS::Identifier::add):
2752 Added a new table to cache UString::Reps created from C strings by address. Elements are
2753 never removed from this cache, as only predefined identifiers can get there.
2756 (KJS::Identifier::Identifier): Added a warning.
2758 2008-03-26 Alexey Proskuryakov <ap@webkit.org>
2760 Rubber-stamped by Maciej.
2762 An assertion was failing in function-toString-object-literals.html when parsing 1e-500.
2763 The condition existed before, and got uncovered by turning compiled-out dtoa checks into
2766 The assertion was verifying that the caller wasn't constructing a Bigint from 0.
2767 This might have had some reason behind it originally, but I couldn't find any,
2768 and this doesn't look like a reasonable requirement.
2770 * kjs/dtoa.cpp: (d2b): Removed the assertion (two copies in different code paths).
2772 2008-03-25 Adam Roben <aroben@apple.com>
2774 Fix Bug 18077: Integrate testapi.c into the Windows build
2776 <http://bugs.webkit.org/show_bug.cgi?id=18077>
2778 Reviewed by Steve Falkenburg.
2780 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Added.
2782 2008-03-25 Adam Roben <aroben@apple.com>
2784 Make testapi.c compile under MSVC
2786 Currently you must compile testapi.c as C++ code since MSVC does not
2787 support many C features that GCC does.
2789 Reviewed by Steve Falkenburg.
2792 (nan): Added an implementation of this for MSVC.
2793 (assertEqualsAsUTF8String): Use malloc instead of dynamically-sized
2795 (assertEqualsAsCharactersPtr): Ditto.
2796 (print_callAsFunction): Ditto.
2797 (main): Ditto, and explicitly cast from UniChar* to JSChar*.
2799 2008-03-25 Adam Roben <aroben@apple.com>
2801 Stop using JavaScriptCore's custom stdbool.h and stdint.h on Windows
2803 We can't remove the os-win32 directory yet because other ports (at
2804 least wx) are still relying on it.
2806 Reviewed by Steve Falkenburg.
2808 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2809 - Made all the include paths match the one for the Debug
2810 configuration (these got out of sync in r30797)
2811 - Removed os-win32 from the include path
2812 - Removed os-win32 from the directories we copy to $WebKitOutputDir.
2813 - Removed stdint.h from the project
2814 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2815 Delete the files that we may have previously copied from the os-win32
2818 2008-03-25 Alexey Proskuryakov <ap@webkit.org>
2822 * kjs/dtoa.cpp: Include stdint.h.
2824 2008-03-25 Alexey Proskuryakov <ap@webkit.org>
2826 Rubber-stamped by Darin.
2828 Cleanup dtoa.cpp style.
2850 (Bigint::kjs_strtod):
2853 (Bigint::nrv_alloc):
2854 (Bigint::kjs_freedtoa):
2858 2008-03-24 Darin Adler <darin@apple.com>
2862 - convert a JavaScript immediate number to a string more efficiently
2864 2% speedup of Acid3 test 26
2866 * kjs/JSImmediate.cpp:
2867 (KJS::JSImmediate::toString): Take advantage of the fact that all immediate
2868 numbers are integers, and use the faster UString function for formatting integers
2869 instead of the slower one that works for floating point. I think this is a leftover
2870 from when immediate numbers were floating point.
2872 2008-03-23 Sam Weinig <sam@webkit.org>
2874 Reviewed by Darin Adler.
2876 Fix http://bugs.webkit.org/show_bug.cgi?id=18048
2877 The "thisObject" parameter to JSEvaluateScript is not used properly
2879 Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created
2883 (main): Add tests for setting the thisObject when calling JSEvaluateScript.
2885 * kjs/ExecState.cpp:
2886 (KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment.
2888 2008-03-22 Jesse Ruderman <jruderman@gmail.com>
2890 Reviewed by Sam Weinig. Landed by eseidel.
2892 Make testkjs flush stdout after printing.
2894 * JavaScriptCore.xcodeproj/project.pbxproj:
2898 2008-03-21 Oliver Hunt <oliver@apple.com>
2902 Optimise lookup of Math, undefined, NaN and Infinity
2904 Added a method to JSVariableObject to allow us to inject DontDelete properties
2905 into the symbol table and localStorage. This results in a 0.4% progression in
2906 SunSpider, with a 8% gain in math-partial-sums.
2908 * kjs/JSGlobalObject.cpp:
2909 (KJS::JSGlobalObject::reset):
2910 * kjs/JSVariableObject.h:
2911 (KJS::JSVariableObject::symbolTableInsert):
2913 2008-03-21 Oliver Hunt <oliver@apple.com>
2915 Reviewed by Geoff Garen.
2917 Global properties that use LocalStorage are not correctly listed as enumerable.
2919 The problem was caused by JSObject::getPropertyAttributes not being aware
2920 of the JSVariableObject SymbolTable. The fix is to make getPropertyAttributes
2921 virtual and override in JSVariableObject. This does not produce any performance
2924 * JavaScriptCore.exp:
2925 * kjs/JSVariableObject.cpp:
2926 (KJS::JSVariableObject::getPropertyNames):
2927 (KJS::JSVariableObject::getPropertyAttributes):
2928 * kjs/JSVariableObject.h:
2931 2008-03-21 Arkadiusz Miskiewicz <arekm@maven.pl>
2933 Webkit does not build on linux powerpc
2935 <http://bugs.webkit.org/show_bug.cgi?id=17019>
2937 Reviewed by David Kilzer.
2940 (TCMalloc_SpinLock::Unlock):
2942 2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com>
2946 http://bugs.webkit.org/show_bug.cgi?id=17981
2948 Add javascriptcore_cppflags to Programs_minidom_CPPFLAGS.
2952 2008-03-21 Alexey Proskuryakov <ap@webkit.org>
2954 Reviewed by Oliver Hunt.
2956 Consolidate static identifier initializers within CommonIdentifiers.
2958 No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).
2960 * kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized
2961 throughout the code.
2963 * kjs/date_object.cpp:
2964 (KJS::DateObjectImp::DateObjectImp):
2965 * kjs/function_object.cpp:
2966 (KJS::FunctionPrototype::FunctionPrototype):
2967 * kjs/object_object.cpp:
2968 (KJS::ObjectPrototype::ObjectPrototype):
2969 * kjs/regexp_object.cpp:
2970 (KJS::RegExpPrototype::RegExpPrototype):
2971 Use the values from CommonIdentifiers.
2973 * kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
2976 (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
2979 (wtf_atan2): Having local variables for numeric_limits constants is good for readability,
2980 but there is no reason to keep them static.
2982 * JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head.
2984 2008-03-20 Oliver Hunt <oliver@apple.com>
2988 Fix for leak introduced by inline ScopeChainNode use
2990 To avoid any extra branches when managing an inline ScopeChainNode
2991 in the ScopeChain the inline node gets inserted with a refcount of
2992 2. This meant than when the ScopeChain was destroyed the ScopeChainNodes
2993 above the inline node would be leaked.
2995 We resolve this by manually popping the inline node in the
2996 FunctionExecState destructor.
2998 * JavaScriptCore.xcodeproj/project.pbxproj:
2999 * kjs/ExecStateInlines.h:
3000 (KJS::FunctionExecState::~FunctionExecState):
3001 * kjs/scope_chain.h:
3002 (KJS::ScopeChain::popInlineScopeNode):
3004 2008-03-20 Mark Rowe <mrowe@apple.com>
3006 Reviewed by Sam Weinig.
3008 Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
3009 This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
3012 * Configurations/JavaScriptCore.xcconfig:
3014 2008-03-20 David Krause <david.krause@gmail.com>
3016 Reviewed by David Kilzer.
3018 Fix http://bugs.webkit.org/show_bug.cgi?id=17923
3019 Bug 17923: ARM platform endian defines inaccurate
3022 Replaced !defined(__ARMEL__) check with !defined(__VFP_FP__)
3023 for PLATFORM(MIDDLE_ENDIAN)
3025 2008-03-20 Maciej Stachowiak <mjs@apple.com>
3029 * JavaScriptCore.xcodeproj/project.pbxproj: install Activation.h as private
3031 2008-03-20 Maciej Stachowiak <mjs@apple.com>
3035 - reduce function call overhead for 1.014x speedup on SunSpider
3037 I moved some functions from ExecState.cpp to ExecStateInline.h and
3038 from JSGlobalObject.cpp to JSGlobalObject.h, and declared them
3039 inline; machine function call overhead for these was hurting JS
3040 funcion call overhead.
3042 * kjs/ExecState.cpp:
3043 * kjs/ExecStateInlines.h: Added.
3044 (KJS::ExecState::ExecState):
3045 (KJS::ExecState::~ExecState):
3046 (KJS::FunctionExecState::FunctionExecState):
3047 (KJS::FunctionExecState::~FunctionExecState):
3048 * kjs/JSGlobalObject.cpp:
3049 * kjs/JSGlobalObject.h:
3050 (KJS::JSGlobalObject::pushActivation):
3051 (KJS::JSGlobalObject::checkActivationCount):
3052 (KJS::JSGlobalObject::popActivation):
3055 2008-03-19 Oliver Hunt <oliver@apple.com>
3059 Avoid heap allocating the root scope chain node for eval and closure free functions
3061 Maciej suggested using an inline ScopeChainNode for functions that don't use eval
3062 or closures as they are unable to ever capture the scope chain. This gives us a 2.4%
3063 win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number
3066 * kjs/ExecState.cpp:
3067 (KJS::ExecState::ExecState):
3069 * kjs/scope_chain.h:
3070 (KJS::ScopeChain::push):
3072 2008-03-19 Mark Rowe <mrowe@apple.com>
3074 Reviewed by Sam Weinig.
3078 * kjs/JSGlobalObject.cpp: Add missing #include.
3080 2008-03-19 Sam Weinig <sam@webkit.org>
3082 Reviewed by Anders Carlsson.
3084 Fix for <rdar://problem/5785694>
3085 Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
3087 Make the activeExecStates stack per JSGlobalObject instead of static to ensure
3090 * JavaScriptCore.exp:
3091 * kjs/ExecState.cpp:
3092 (KJS::InterpreterExecState::InterpreterExecState):
3093 (KJS::InterpreterExecState::~InterpreterExecState):
3094 (KJS::EvalExecState::EvalExecState):
3095 (KJS::EvalExecState::~EvalExecState):
3096 (KJS::FunctionExecState::FunctionExecState):
3097 (KJS::FunctionExecState::~FunctionExecState):
3100 * kjs/JSGlobalObject.cpp:
3101 (KJS::JSGlobalObject::mark):
3102 * kjs/JSGlobalObject.h:
3103 (KJS::JSGlobalObject::activeExecStates):
3104 * kjs/collector.cpp:
3105 (KJS::Collector::collect):
3106 (KJS::Collector::reportOutOfMemoryToAllExecStates): Iterate all JSGlobalObjects and report
3107 the OutOfMemory condition to all the ExecStates in each.
3109 2008-03-19 Jasper Bryant-Greene <jasper@unix.geek.nz>
3111 Reviewed by Maciej Stachowiak.
3113 Fix http://bugs.webkit.org/show_bug.cgi?id=17941
3114 Bug 17941: C++-style comments in JavaScriptCore API
3117 Remove C++-style comments from public JavaScriptCore API, replacing
3118 with standard C90 block comments.
3120 2008-03-19 Mark Rowe <mrowe@apple.com>
3122 Reviewed by Oliver Hunt.
3124 Fix http://bugs.webkit.org/show_bug.cgi?id=17939
3125 Bug 17939: Crash decompiling "const a = 1, b;"
3127 * kjs/nodes2string.cpp:
3128 (KJS::ConstDeclNode::streamTo): Null-check the correct variable.
3130 2008-03-18 Oliver Hunt <oliver@apple.com>
3132 Reviewed by Mark Rowe.
3134 Bug 17929: Incorrect decompilation with |const|, comma
3135 http://bugs.webkit.org/show_bug.cgi?id=17929
3137 There were actually two bugs here. First we weren't correctly handling const
3138 nodes with multiple declarations. The second issue was caused by us not
3139 giving the correct precedence to the initialisers.
3141 * kjs/nodes2string.cpp:
3142 (KJS::ConstDeclNode::streamTo):
3144 2008-03-18 Darin Adler <darin@apple.com>
3148 - Speed up JavaScript built-in properties by changing the
3149 hash table to take advantage of the identifier objects
3151 5% speedup for Acid3 test 26
3153 * JavaScriptCore.exp: Updated.
3154 * kjs/create_hash_table: Compute size of hash table large enough so that there
3155 are no collisions, but don't generate the hash table.
3156 * kjs/identifier.h: Made the add function that returns a PassRefPtr public.
3158 (KJS::Lexer::lex): Updated for change to HashTable interface.
3160 (KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for
3161 each property so the equality comparision can be done with pointer comparision.
3162 * kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can
3163 hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed
3164 the Lookup functions to be member functions of HashTable instead.
3166 (KJS::JSObject::deleteProperty): Update for change to HashTable.
3167 (KJS::JSObject::findPropertyHashEntry): Ditto.
3168 (KJS::JSObject::getPropertyAttributes): Ditto.
3169 (KJS::JSObject::getPropertyNames): Ditto.
3171 2008-03-18 Mark Rowe <mrowe@apple.com>
3173 Reviewed by Oliver Hunt.
3175 Fix http://bugs.webkit.org/show_bug.cgi?id=17925 and http://bugs.webkit.org/show_bug.cgi?id=17927.
3176 - Bug 17925: Crash in KJS::JSObject::put after setting this.__proto__
3177 - Bug 17927: Hang after attempting to create circular __proto__
3180 (KJS::JSObject::put): Silently ignore attempts to set __proto__ to a non-object, non-null value.
3181 Return after setting the exception when an attempt to set a cyclic __proto__ is detected so that
3182 the cyclic value is not set.
3184 2008-03-18 Maciej Stachowiak <mjs@apple.com>
3188 - inline ActivationImp::init for 0.8% SunSpider speedup
3191 (KJS::ActivationImp::init): Moved here from function.cpp
3194 2008-03-18 Simon Hausmann <hausmann@webkit.org>
3198 Including config.h like in the other .cpp files gets the #ifdeffery
3201 * kjs/JSWrapperObject.cpp:
3203 2008-03-17 Darin Adler <darin@apple.com>
3207 JavaScriptCore changes to support a WebCore speedup.
3209 * JavaScriptCore.exp: Export the UString::Rep::computeHash function.
3210 * wtf/HashSet.h: Added a find and contains function that take a translator,
3211 like the add function.
3213 2008-03-18 Maciej Stachowiak <mjs@apple.com>
3217 - a few micro-optimizations for 1.2% SunSpider speedup
3220 (KJS::FunctionImp::callAsFunction): check for Return completion before Throw,
3223 (KJS::JSObject::put): When walking prototype chain, instead of
3224 checking isObject (a virtual call), compare to jsNull (compare to
3225 a constant) since null is the only non-object that can be in a
3228 2008-03-17 Oliver Hunt <oliver@apple.com>
3232 Optimise multi-scope function call resolution
3234 Refactor multiscope variable resolution and use to add
3235 optimised FunctionCallResolveNode subclasses.
3237 2.6% gain in sunspider performance, *25%* gain in controlflow-recursive
3240 (KJS::getSymbolTableEntry):
3241 (KJS::ResolveNode::optimizeVariableAccess):
3242 (KJS::getNonLocalSymbol):
3243 (KJS::ExpressionNode::resolveAndCall):
3244 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
3245 (KJS::FunctionCallResolveNode::inlineEvaluate):
3246 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
3247 (KJS::ScopedVarFunctionCallNode::evaluate):
3248 (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
3249 (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
3250 (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
3251 (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
3252 (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
3253 (KJS::NonLocalVarFunctionCallNode::evaluate):
3254 (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
3255 (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
3256 (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
3257 (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
3259 (KJS::ScopedVarFunctionCallNode::):
3260 (KJS::NonLocalVarFunctionCallNode::):
3262 2008-03-17 David Kilzer <ddkilzer@apple.com>
3264 Don't define PLATFORM(MIDDLE_ENDIAN) on little endian ARM.
3268 See <http://bugs.webkit.org/show_bug.cgi?id=15416#c13>.
3270 * wtf/Platform.h: Added check for !defined(__ARMEL__) when defining
3271 PLATFORM(MIDDLE_ENDIAN).
3273 2008-03-17 Oliver Hunt <oliver@apple.com>
3275 Reviewed by Geoff, Darin and Weinig.
3277 Add fast multi-level scope lookup
3279 Add logic and AST nodes to provide rapid variable resolution across
3280 static scope boundaries. This also adds logic that allows us to skip
3281 any static scopes that do not contain the variable to be resolved.
3283 This results in a ~2.5% speedup in SunSpider, and gives a 25-30% speedup
3284 in some simple and ad hoc closure and global variable access tests.
3286 * JavaScriptCore.exp:
3288 * kjs/JSGlobalObject.cpp:
3289 * kjs/JSGlobalObject.h:
3290 * kjs/JSVariableObject.cpp:
3291 * kjs/JSVariableObject.h:
3293 (KJS::ActivationImp::isDynamicScope):
3295 (KJS::ResolveNode::optimizeVariableAccess):
3296 (KJS::ScopedVarAccessNode::inlineEvaluate):
3297 (KJS::ScopedVarAccessNode::evaluate):
3298 (KJS::ScopedVarAccessNode::evaluateToNumber):
3299 (KJS::ScopedVarAccessNode::evaluateToBoolean):
3300 (KJS::ScopedVarAccessNode::evaluateToInt32):
3301 (KJS::ScopedVarAccessNode::evaluateToUInt32):
3302 (KJS::NonLocalVarAccessNode::inlineEvaluate):
3303 (KJS::NonLocalVarAccessNode::evaluate):
3304 (KJS::NonLocalVarAccessNode::evaluateToNumber):
3305 (KJS::NonLocalVarAccessNode::evaluateToBoolean):
3306 (KJS::NonLocalVarAccessNode::evaluateToInt32):
3307 (KJS::NonLocalVarAccessNode::evaluateToUInt32):
3308 (KJS::IfElseNode::optimizeVariableAccess):
3309 (KJS::ScopeNode::optimizeVariableAccess):
3311 (KJS::ScopedVarAccessNode::):
3312 (KJS::NonLocalVarAccessNode::):
3315 2008-03-16 weihongzeng <weihong.zeng@hotmail.com>
3317 Reviewed by Darin Adler.
3319 http://bugs.webkit.org/show_bug.cgi?id=15416
3320 Add support for mixed-endian processors
3322 * kjs/dtoa.cpp: Add IEEE_ARM, triggered by PLATFORM(MIDDLE_ENDIAN).
3324 2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
3326 Rubber stamped by Darin.
3328 Add set-webkit-configuration support for wx port, and centralize
3329 build dir location setting.
3331 http://bugs.webkit.org/show_bug.cgi?id=17790
3335 2008-03-14 Steve Falkenburg <sfalken@apple.com>
3339 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3341 2008-03-14 Oliver Hunt <oliver@apple.com>
3345 Add logic to track whether a function uses a locally scoped eval or requires a closure
3347 Now that we limit eval we can track those uses of eval that operate
3348 in the local scope and functions that require a closure. We track
3349 this information during initial parsing to avoid yet another tree
3352 * JavaScriptCore.exp:
3355 (KJS::Parser::didFinishParsing):
3357 (KJS::Parser::parse):
3360 (KJS::ScopeNode::ScopeNode):
3361 (KJS::ProgramNode::ProgramNode):
3362 (KJS::ProgramNode::create):
3363 (KJS::EvalNode::EvalNode):
3364 (KJS::EvalNode::create):
3365 (KJS::FunctionBodyNode::FunctionBodyNode):
3366 (KJS::FunctionBodyNode::create):
3369 (KJS::ScopeNode::usesEval):
3370 (KJS::ScopeNode::needsClosure):
3372 2008-03-14 Geoffrey Garen <ggaren@apple.com>
3374 Reviewed by Beth Dakin.
3376 Fixed another problem with Vector::shrinkCapacity.
3378 moveOverlapping isn't good enough for the case where the buffer hasn't
3379 changed, because it still destroys the contents of the buffer.
3382 (WTF::::shrinkCapacity): Changed to explicitly check whether the call
3383 to allocateBuffer produced a new buffer. If it didn't, there's no need
3386 2008-03-14 Geoffrey Garen <ggaren@apple.com>
3388 Reviewed by Beth Dakin.
3390 Fixed a few problems with Vector::shrinkCapacity that I noticed in testing.
3393 (WTF::VectorBufferBase::deallocateBuffer): Clear our m_buffer pointer
3394 when we deallocate m_buffer, in case we're not asked to reallocate a new
3395 buffer. (Otherwise, we would use a stale m_buffer if we were asked to
3396 perform any operations after shrinkCapacity was called.)
3398 (WTF::VectorBuffer::allocateBuffer): Made VectorBuffer with inline
3399 capacity aware that calls to allocateBuffer might be shrinks, rather
3400 than grows, so we shouldn't allocate a new buffer on the heap unless
3401 our inline buffer is too small.
3403 (WTF::::shrinkCapacity): Call resize() instead of just setting m_size,
3404 so destructors run. Call resize before reallocating the buffer to make
3405 sure that we still have access to the objects we need to destroy. Call
3406 moveOverlapping instead of move, since a call to allocateBuffer on an
3407 inline buffer may produce identical storage.
3409 2008-03-14 Alexey Proskuryakov <ap@webkit.org>
3413 Get rid of a localime() call on platforms that have better alternatives.
3415 * kjs/DateMath.h: Added getLocalTime();
3418 (KJS::getLocalTime):
3419 (KJS::getDSTOffsetSimple):
3420 Implementation moved from getDSTOffsetSimple().
3422 * kjs/date_object.cpp:
3423 (KJS::DateObjectImp::callAsFunction): Switched to getLocalTime().
3425 2008-03-14 David D. Kilzer <ddkilzer@apple.com>
3427 Unify concept of enabling the Mac Java bridge.
3429 Reviewed by Darin and Anders.
3431 * wtf/Platform.h: Define ENABLE_MAC_JAVA_BRIDGE here.
3433 2008-03-13 Mark Mentovai <mark@moxienet.com>
3435 Reviewed by eseidel. Landed by eseidel.
3437 * wtf/FastMalloc.cpp: #include <wtf/HashSet.h> outside of any
3440 2008-03-13 Mark Mentovai <mark@moxienet.com>
3442 Reviewed by eseidel. Landed by eseidel.
3444 * pcre/pcre_exec.cpp: Fix misnamed variable, allowing -DDEBUG build
3446 * wtf/ThreadingPthreads.cpp: #include <sys/time.h> for gettimeofday
3449 2008-03-13 Steve Falkenburg <sfalken@apple.com>
3453 Disable PGO for normal release builds.
3454 Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
3456 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3458 2008-03-13 Beth Dakin <bdakin@apple.com>
3462 Adding new functionality to Vector. Currently all of the shrink and
3463 resize functions on Vector only shrink the size of the Vector, not
3464 the capacity. For the Vector to take up as little memory as
3465 possible, though, it is necessary to be able to shrink the capacity
3466 as well. So this patch adds that functionality.
3468 I need this for a speed up I am working on, and Geoff wants to use
3469 it in a speed up he is working on also, so he asked me to commit it
3473 (WTF::VectorBufferBase::allocateBuffer):
3474 (WTF::::shrinkCapacity):
3476 2008-03-13 Simon Hausmann <hausmann@webkit.org>
3478 Reviewed by Adam Roben.
3480 Attempt at fixing the Qt/Windows build bot. Quote using double-quotes
3481 instead of single quotes.
3485 2008-03-12 Steve Falkenburg <sfalken@apple.com>
3489 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3491 2008-03-12 Alp Toker <alp@atoker.com>
3493 Another autotools testkjs build fix attempt.
3497 2008-03-12 Alp Toker <alp@atoker.com>
3499 Attempt to fix the autotools testkjs build on systems with
3500 non-standard include paths.
3504 2008-03-11 Alexey Proskuryakov <ap@webkit.org>
3508 <rdar://problem/5787743> REGRESSION: Crash at WTF::Collator::CreateCollator() running fast/js/kde/StringObject.html on Windows
3510 * wtf/unicode/icu/CollatorICU.cpp:
3511 (WTF::Collator::createCollator): Check for null (== user default) m_locale before calling strcmp.
3513 2008-03-11 Steve Falkenburg <sfalken@apple.com>
3515 Disable LTCG/PGO for grammar.cpp and nodes.cpp.
3516 PGO on these files causes us to hang.
3518 Copy newer vsprops files from relative WebKitLibraries path to environment variable based path.
3522 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3523 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3525 2008-03-10 Darin Adler <darin@apple.com>
3529 * kjs/function.cpp: (KJS::decode): Initialize variable.
3531 2008-03-10 Brent Fulgham <bfulgham@gmail.com>
3537 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3538 Set the PATH to include Cygwin before running touch.
3540 2008-03-10 Eric Seidel <eric@webkit.org>
3542 Build fix for JSC on windows.
3544 * API/JSStringRefCF.cpp:
3545 (JSStringCreateWithCFString):
3548 * kjs/nodes2string.cpp:
3549 (KJS::escapeStringForPrettyPrinting):
3551 2008-03-10 Eric Seidel <eric@webkit.org>
3553 No review, build fix only.
3555 Attempt to fix the windows build?
3557 * kjs/ustring.h: change unsigned short to UChar
3559 2008-03-10 Eric Seidel <eric@webkit.org>
3563 Remove KJS::UChar, use ::UChar instead
3564 http://bugs.webkit.org/show_bug.cgi?id=17017
3566 * API/JSStringRef.cpp:
3567 (JSStringCreateWithCharacters):
3568 (JSStringCreateWithUTF8CString):
3569 * API/JSStringRefCF.cpp:
3570 (JSStringCreateWithCFString):
3571 * JavaScriptCore.exp:
3577 (KJS::globalFuncEscape):
3578 (KJS::globalFuncUnescape):
3579 * kjs/function_object.cpp:
3580 (KJS::FunctionObjectImp::construct):
3581 * kjs/identifier.cpp:
3582 (KJS::Identifier::equal):
3583 (KJS::CStringTranslator::translate):
3584 * kjs/interpreter.h:
3586 (KJS::Lexer::setCode):
3587 (KJS::Lexer::shift):
3589 (KJS::Lexer::convertUnicode):
3590 (KJS::Lexer::makeIdentifier):
3593 * kjs/nodes2string.cpp:
3594 (KJS::escapeStringForPrettyPrinting):
3595 (KJS::SourceStream::operator<<):
3597 (KJS::RegExp::RegExp):
3598 (KJS::RegExp::match):
3599 * kjs/string_object.cpp:
3600 (KJS::substituteBackreferences):
3601 (KJS::stringProtoFuncCharCodeAt):
3602 (KJS::stringProtoFuncToLowerCase):
3603 (KJS::stringProtoFuncToUpperCase):
3604 (KJS::stringProtoFuncToLocaleLowerCase):
3605 (KJS::stringProtoFuncToLocaleUpperCase):
3607 (KJS::UString::Rep::computeHash):
3608 (KJS::UString::UString):
3609 (KJS::UString::append):
3610 (KJS::UString::ascii):
3611 (KJS::UString::operator=):
3612 (KJS::UString::is8Bit):
3613 (KJS::UString::toStrictUInt32):
3614 (KJS::UString::find):
3618 (KJS::UString::UTF8String):
3622 2008-03-09 Steve Falkenburg <sfalken@apple.com>
3624 Stop Windows build if an error occurs in a prior project.
3626 Rubber stamped by Darin.
3628 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3629 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3630 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3631 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3633 2008-03-09 J¸rg Billeter <j@bitron.ch>
3635 Reviewed by Alp Toker.
3637 Conditionalise ICU for Unicode in the GTK+ port.
3641 2008-03-07 David D. Kilzer <ddkilzer@apple.com>
3643 Unify concept of enabling Netscape Plug-in API (NPAPI).
3647 * wtf/Platform.h: Define ENABLE_NETSCAPE_PLUGIN_API here.
3649 2008-03-07 Geoffrey Garen <ggaren@apple.com>
3651 Reviewed by Darin Adler.
3653 Fixed <rdar://problem/5689093> Stricter (ES4) eval semantics
3657 - "eval(s)" is treated as an operator that gives the ES3 eval behavior.
3658 ... but only if there is no overriding declaration of "eval" in scope.
3659 - All other invocations treat eval as a function that evaluates a
3660 script in the context of its "this" object.
3661 ... but if its "this" object is not the global object it was
3662 originally associated with, eval throws an exception.
3664 Because only expressions of the form "eval(s)" have access to local
3665 scope, the compiler can now statically determine whether a function
3666 needs local scope to be dynamic.
3668 * kjs/nodes.h: Added FunctionCallEvalNode. It works just like
3669 FuncationCallResolveNode, except it statically indicates that the node
3670 may execute eval in the ES3 way.
3672 * kjs/nodes2string.cpp:
3674 * tests/mozilla/expected.html: This patch happens to fix a Mozilla JS
3675 test, but it's a bit of a pyrrhic victory. The test intends to test
3676 Mozilla's generic API for calling eval on any object, but, in reality,
3677 we only support calling eval on the global object.
3679 2008-03-06 Steve Falkenburg <sfalken@apple.com>
3683 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3685 2008-03-06 Steve Falkenburg <sfalken@apple.com>
3689 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3691 2008-03-06 Alp Toker <alp@atoker.com>
3693 Fix the build fix in r30845 to support out-of-tree builds.
3697 2008-03-06 Steve Falkenburg <sfalken@apple.com>
3701 * wtf/ThreadingWin.cpp:
3702 (WTF::ThreadCondition::timedWait):
3704 2008-03-06 Darin Adler <darin@apple.com>
3706 - another small step towards fixing the Qt build
3708 * JavaScriptCore.pri: Remove more references to the now-obsolete bindings directory.
3710 2008-03-06 Darin Adler <darin@apple.com>
3712 - a small step towards fixing the Qt build
3714 * JavaScriptCore.pri: Remove references to files no longer present in JavaScriptCore/bindings.
3716 2008-03-06 Brady Eidson <beidson@apple.com>
3720 * wtf/ThreadingGtk.cpp:
3721 (WTF::ThreadCondition::timedWait):
3723 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
3727 * wtf/unicode/icu/CollatorICU.cpp:
3728 (WTF::Collator::userDefault): Put ICU workaround under both PLATFORM(DARWIN) and
3729 PLATFORM(CF) checks, so that each port can decide if it wants to use CF on Mac for it.
3731 2008-03-06 Brady Eidson <beidson@apple.com>
3735 Add a timedWait() method to ThreadCondition
3737 * JavaScriptCore.exp:
3741 * wtf/ThreadingGtk.cpp:
3742 (WTF::ThreadCondition::timedWait):
3744 * wtf/ThreadingNone.cpp:
3745 (WTF::ThreadCondition::timedWait):
3747 * wtf/ThreadingPthreads.cpp:
3748 (WTF::ThreadCondition::timedWait):
3750 * wtf/ThreadingWin.cpp:
3751 (WTF::ThreadCondition::timedWait): Needs implementation
3753 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
3757 * jscore.bkl: Add the wtf/unicode directory.
3758 * wtf/unicode/CollatorDefault.cpp:
3759 (WTF::Collator::userDefault): Use a constructor that does exist.
3760 * wtf/unicode/icu/CollatorICU.cpp: Mac build fix for case-sensitive file systems.
3762 2008-03-06 Darin Adler <darin@apple.com>
3764 - try to fix the Qt build
3766 * JavaScriptCore.pri: Add the wtf/unicode directory.
3768 2008-03-06 Darin Adler <darin@apple.com>
3770 - try to fix the GTK build
3772 * GNUmakefile.am: Add a -I for the wtf/unicode directory.
3774 2008-03-06 Darin Adler <darin@apple.com>
3776 - try to fix the Mac build
3778 * icu/unicode/parseerr.h: Copied from ../WebCore/icu/unicode/parseerr.h.
3779 * icu/unicode/ucol.h: Copied from ../WebCore/icu/unicode/ucol.h.
3780 * icu/unicode/uloc.h: Copied from ../WebCore/icu/unicode/uloc.h.
3781 * icu/unicode/unorm.h: Copied from ../WebCore/icu/unicode/unorm.h.
3782 * icu/unicode/uset.h: Copied from ../WebCore/icu/unicode/uset.h.
3784 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
3788 <rdar://problem/5687269> Need to create a Collator abstraction for WebCore and JavaScriptCore
3791 (WTF::initializeThreading):
3792 * wtf/ThreadingGtk.cpp:
3793 (WTF::initializeThreading):
3794 * wtf/ThreadingNone.cpp:
3795 * wtf/ThreadingPthreads.cpp:
3796 * wtf/ThreadingWin.cpp:
3797 Added AtomicallyInitializedStatic.
3799 * kjs/string_object.cpp: (KJS::localeCompare): Changed to use Collator.
3802 * JavaScriptCore.exp:
3803 * JavaScriptCore.pri:
3804 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3805 * JavaScriptCore.xcodeproj/project.pbxproj:
3806 * JavaScriptCoreSources.bkl:
3807 Added new fiiles to projects.
3809 * wtf/unicode/Collator.h: Added.
3811 * wtf/unicode/CollatorDefault.cpp: Added.
3812 (WTF::Collator::Collator):
3813 (WTF::Collator::~Collator):
3814 (WTF::Collator::setOrderLowerFirst):
3815 (WTF::Collator::collate):
3816 * wtf/unicode/icu/CollatorICU.cpp: Added.
3817 (WTF::cachedCollatorMutex):
3818 (WTF::Collator::Collator):
3819 (WTF::Collator::~Collator):
3820 (WTF::Collator::setOrderLowerFirst):
3821 (WTF::Collator::collate):
3822 (WTF::Collator::createCollator):
3823 (WTF::Collator::releaseCollator):
3825 2008-03-05 Kevin Ollivier <kevino@theolliviers.com>
3827 Fix the wx build after the bindings move.
3829 * JavaScriptCoreSources.bkl:
3832 2008-03-05 Alp Toker <alp@atoker.com>
3834 GTK+ build fix for breakage introduced in r30800.
3836 Track moved bridge sources from JavaScriptCore to WebCore.
3840 2008-03-05 Brent Fulgham <bfulgham@gmail.com>
3842 Reviewed by Adam Roben.
3844 Remove definition of WTF_USE_SAFARI_THEME from wtf/Platform.h
3845 because the PLATFORM(CG) flag is not set until config.h has
3846 already included this file.
3848 * wtf/Platform.h: Remove useless definition of WTF_USE_SAFARI_THEME
3850 2008-03-05 Brady Eidson <beidson@apple.com>
3852 Reviewed by Alexey and Mark Rowe
3854 Fix for <rdar://problem/5778247> - Reproducible crash on storage/execute-sql-args.html
3856 DatabaseThread::unscheduleDatabaseTasks() manually filters through a MessageQueue,
3857 removing particular items for Databases that were shutting down.
3859 This filtering operation is not atomic, and therefore causes a race condition with the
3860 MessageQueue waking up and reading from the message queue.
3862 The end result was an attempt to dereference a null DatabaseTask. Timing-wise, this never
3863 seemed to happen in a debug build, otherwise an assertion would've caught it. Replacing that
3864 assertion with a crash in a release build is what revealed this bug.
3866 * wtf/MessageQueue.h:
3867 (WTF::::waitForMessage): Tweak the waiting logic to check the queue's empty state then go back
3868 to sleep if the queue was empty - checking m_killed each time it wakes up.
3870 2008-03-05 David D. Kilzer <ddkilzer@apple.com>
3872 Remove unused header includes from interpreter.cpp.
3876 * kjs/interpreter.cpp: Remove unused header includes.
3878 2008-03-05 Anders Carlsson <andersca@apple.com>
3884 * bindings: Removed.
3886 2008-03-05 Anders Carlsson <andersca@apple.com>
3888 Don't build bindings/ anymore.
3890 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3892 2008-03-05 Anders Carlsson <andersca@apple.com>
3896 Don't build JavaScriptCore/bindings.
3898 * JavaScriptCore.exp:
3899 Export a couple of new functions.
3901 * JavaScriptCore.xcodeproj/project.pbxproj:
3905 No need to define HAVE_JNI anymore.
3907 * kjs/interpreter.cpp:
3908 Remove unnecessary include.
3910 2008-03-05 David D. Kilzer <ddkilzer@apple.com>
3912 Allow override of default script file name using command-line argument.
3917 (main): Allow first command-line argument to override the default script
3918 file name of "minidom.js".
3920 (main): Allow first command-line argument to override the default script
3921 file name of "testapi.js".
3923 2008-03-04 Mark Rowe <mrowe@apple.com>
3927 * JavaScriptCore.exp: Add new symbol to exports file.
3929 2008-03-03 Oliver Hunt <oliver@apple.com>
3933 Make ForInNode check for the timeout interrupt
3936 (KJS::ForInNode::execute):
3938 2008-03-02 Brent Fulgham <bfulgham@gmail.com>
3940 Reviewed by Alp Toker.
3942 http://bugs.webkit.org/show_bug.cgi?id=17415
3943 GTK Build (using autotools) on Mac OS (DarwinPorts) Fails
3945 Add -lstdc++ to link flags for minidom program. This corrects
3946 a build error for the GTK+ on Mac OS.
3950 2008-03-01 Mark Rowe <mrowe@apple.com>
3952 Reviewed by Tim Hatcher.
3954 Update Xcode configuration to support building debug and release from the mysterious future.
3956 * Configurations/Base.xcconfig:
3957 * Configurations/DebugRelease.xcconfig:
3959 2008-02-29 Brent Fulgham <bfulgham@gmail.com>
3961 http://bugs.webkit.org/show_bug.cgi?id=17483
3962 Implement scrollbars on Windows (Cairo)
3964 Reviewed by Adam Roben.
3968 2008-02-29 Adam Roben <aroben@apple.com>
3970 Remove unused DebuggerImp::abort and DebuggerImp::aborted
3972 Reviewed by Tim and Sam.
3974 * kjs/function_object.cpp:
3975 (KJS::FunctionObjectImp::construct):
3977 (KJS::DebuggerImp::DebuggerImp):
3979 (KJS::Node::handleException):
3980 (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
3982 2008-02-28 Eric Christopher <echristo@apple.com>
3984 Reviewed by Geoffrey Garen.
3986 ** TOTAL **: 1.005x as fast 2867.6ms +/- 0.4% 2853.2ms +/- 0.3% significant
3988 * kjs/nodes.cpp: Tell the compiler that exceptions are unexpected (for
3989 the sake of branch prediction and code organization).
3991 2008-02-27 Alexey Proskuryakov <ap@webkit.org>
3993 Reviewed by Sam Weinig.
3995 http://bugs.webkit.org/show_bug.cgi?id=17030
3996 Small buffer overflow within initialization
3998 * kjs/date_object.cpp:
3999 (KJS::DateObjectFuncImp::callAsFunction):
4001 Remove unnecessary and incorrect memset() calls - GregorianDateTime can initialize itself.
4003 2008-02-25 Sam Weinig <sam@webkit.org>
4005 Reviewed by Dan Bernstein.
4007 - Add a variant of remove that takes a position and a length.
4010 (WTF::Vector::remove):
4012 2008-02-25 Mark Mentovai <mark@moxienet.com>
4014 Reviewed by Mark Rowe.
4016 Enable CollectorHeapIntrospector to build by itself, as well as in an AllInOneFile build.
4017 http://bugs.webkit.org/show_bug.cgi?id=17538
4019 * kjs/CollectorHeapIntrospector.cpp: Provide "using" declaration for
4020 WTF::RemoteMemoryReader.
4021 * kjs/collector.h: Move CollectorHeap declaration here...
4022 * kjs/collector.cpp: ... from here.
4024 2008-02-25 Darin Adler <darin@apple.com>
4028 * JavaScriptCore.exp: Sort the contents of this file.
4030 2008-02-25 Adam Roben <aroben@apple.com>
4035 (functionQuit): Don't add a return statement after exit(0) for MSVC.
4037 2008-02-24 Sam Weinig <sam@webkit.org>
4039 Reviewed by Mark Rowe.
4041 http://bugs.webkit.org/show_bug.cgi?id=17529
4042 Add support for reading from stdin from testkjs
4045 (GlobalObject::GlobalObject): Add readline function to global object.
4046 (functionReadline): Added. Reads characters from stdin until a '\n' or
4047 EOF is encountered. The input is returned as a String to the caller.
4049 2008-02-24 Sam Weinig <sam@webkit.org>
4051 Reviewed by Mark Rowe.
4053 http://bugs.webkit.org/show_bug.cgi?id=17528
4056 * JavaScriptCore.exp:
4057 * JavaScriptCore.xcodeproj/project.pbxproj: Make the testkjs.cpp use 4 space indentation.
4059 (StopWatch::getElapsedMS):
4060 (GlobalObject::className):
4061 (GlobalObject::GlobalObject):
4062 Rename GlobalImp to GlobalObject and setup the global functions
4063 in the GlobalObject's constructor. Also, use static functions for
4064 the implementation so we can use the standard PrototypeFunction
4065 class and remove TestFunctionImp.
4066 (functionPrint): Move print() functionality here.
4067 (functionDebug): Move debug() functionality here.
4068 (functionGC): Move gc() functionality here.
4069 (functionVersion): Move version() functionality here.
4070 (functionRun): Move run() functionality here.
4071 (functionLoad): Move load() functionality here.
4072 (functionQuit): Move quit() functionality here.
4073 (prettyPrintScript): Fix indentation.
4074 (runWithScripts): Since all the functionality of createGlobalObject is
4075 now in the GlobalObject constructor, just call new here.
4076 (parseArguments): Fix indentation.
4078 (fillBufferWithContentsOfFile): Ditto.
4080 2008-02-24 Sam Weinig <sam@webkit.org>
4082 Reviewed by Oliver Hunt and Mark Rowe.
4084 http://bugs.webkit.org/show_bug.cgi?id=17505
4085 Add support for getting command line arguments in testkjs
4087 - This slightly changes the behavior of parsing arguments by requiring
4088 a '-f' before all files.
4091 (createGlobalObject): Add a global property called 'arguments' which
4092 contains an array with the parsed arguments as strings.
4093 (runWithScripts): Pass in the arguments vector so that it can be passed
4094 to the global object.
4095 (parseArguments): Change parsing rules to require a '-f' before any script
4096 file. After all '-f' and '-p' arguments have been parsed, the remaining
4097 are added to the arguments vector and exposed to the script. If there is a
4098 chance of ambiguity (the user wants to pass the string '-f' to the script),
4099 the string '--' can be used separate the options from the pass through
4103 2008-02-24 Dan Bernstein <mitz@apple.com>
4105 Reviewed by Darin Adler.
4107 - fix http://bugs.webkit.org/show_bug.cgi?id=17511
4108 REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
4111 (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
4112 are both zero but the buffer capacity is non-zero.
4113 (WTF::::prepend): Added validity checks.
4115 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
4117 Rubber stamped by Darin.
4119 Add separator '\' after libJavaScriptCore_la_LIBADD and cleanup
4120 whitespaces introduced in the previous commit.
4124 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
4126 * GNUmakefile.am: Add GLOBALDEPS for testkjs and minidom.
4128 2008-02-23 Darin Adler <darin@apple.com>
4132 - http://bugs.webkit.org/show_bug.cgi?id=17496
4133 make Deque use a circular array; add iterators
4135 * wtf/Deque.h: Wrote an all-new version of this class that uses a circular
4136 buffer. Growth policy is identical to vector. Added iterators.
4138 * wtf/Vector.h: Made two small refinements while using this to implement
4139 Deque: Made VectorBufferBase derive from Noncopyable, which would have
4140 saved me some debugging time if it had been there. Renamed Impl and
4141 m_impl to Buffer and m_buffer.
4143 2008-02-23 Darin Adler <darin@apple.com>
4147 - http://bugs.webkit.org/show_bug.cgi?id=17067
4148 eliminate attributes parameter from JSObject::put for speed/clarity
4150 * API/JSCallbackObject.h: Removed attribute arguments.
4151 * API/JSCallbackObjectFunctions.h:
4152 (KJS::JSCallbackObject<Base>::put): Ditto.
4153 * API/JSObjectRef.cpp:
4154 (JSObjectSetProperty): Use initializeVariable or putDirect when necessary
4155 to set attribute values.
4156 * JavaScriptCore.exp: Updated.
4157 * bindings/objc/objc_runtime.h: Removed attribute arguments.
4158 * bindings/objc/objc_runtime.mm:
4159 (ObjcFallbackObjectImp::put): Ditto.
4160 * bindings/runtime_array.cpp:
4161 (RuntimeArray::put): Ditto.
4162 * bindings/runtime_array.h: Ditto.
4163 * bindings/runtime_object.cpp:
4164 (RuntimeObjectImp::put): Ditto.
4165 * bindings/runtime_object.h: Ditto. Also removed canPut which was only
4166 called from one place in WebCore that can use hasProperty instead.
4168 * kjs/Activation.h: Removed attribute argument from put and added the new
4169 initializeVariable function that's used to put variables in variable objects.
4170 Also made isActivationObject a const member.
4172 * kjs/JSGlobalObject.cpp:
4173 (KJS::JSGlobalObject::put): Removed attribute argument.
4174 (KJS::JSGlobalObject::initializeVariable): Added. Used to give variables
4175 their initial values, which can include the read-only property.
4176 (KJS::JSGlobalObject::reset): Removed obsolete comments about flags.
4177 Removed Internal flag, which is no longer needed.
4178 * kjs/JSGlobalObject.h: More of the same.
4180 * kjs/JSVariableObject.h: Added pure virtual initializeVariable function.
4181 (KJS::JSVariableObject::symbolTablePut): Removed checkReadOnly flag; we always
4183 (KJS::JSVariableObject::symbolTableInitializeVariable): Added.
4185 * kjs/array_instance.cpp: