1 2008-05-15 Ariya Hidayat <ariya.hidayat@trolltech.com>
5 Since WebKitGtk is fully using autotools now, clean-up the .pro/.pri files
11 2008-05-15 Kevin McCullough <kmccullough@apple.com>
17 2008-05-15 Kevin McCullough <kmccullough@apple.com>
21 <rdar://problem/5770054> JavaScript profiler (10928)
22 - Cache some values to save on computing them repetitively. This will be
23 a big savings when we sort since we won't have to walk the tree for
25 - We cache these values when we end profiling because otherwise we won't
26 know which profile to get the totalTime for the whole profile from without
27 retaining a reference to the head profile or looking up the profile from
28 the list of all profiles.
29 - Also it's safe to assume we won't be asked for these values while we
30 are still profiling since the WebInspector only get's profileNodes from
31 profiles that are in the allProfiles() list and a profile is only added
32 to that list after it has finished and these values will no longer
36 * profiler/ProfileNode.cpp:
37 (KJS::ProfileNode::ProfileNode):
38 (KJS::ProfileNode::stopProfiling):
39 (KJS::ProfileNode::printDataInspectorStyle):
40 (KJS::ProfileNode::printDataSampleStyle):
41 (KJS::ProfileNode::endAndRecordCall):
42 * profiler/ProfileNode.h:
43 (KJS::ProfileNode::totalTime):
44 (KJS::ProfileNode::selfTime):
45 (KJS::ProfileNode::totalPercent):
46 (KJS::ProfileNode::selfPercent):
47 * profiler/Profiler.cpp:
48 (KJS::Profiler::stopProfiling):
50 2008-05-15 Simon Hausmann <shausman@trolltech.com>
54 Fix compilation when compiling with MSVC and wchar_t support.
56 * wtf/unicode/qt4/UnicodeQt4.h:
57 (WTF::Unicode::foldCase):
58 (WTF::Unicode::umemcasecmp):
60 2008-05-14 Kevin McCullough <kmccullough@apple.com>
64 <rdar://problem/5770054> JavaScript profiler (10928)
65 - Turn on the profiler.
69 2008-05-14 Kevin McCullough <kmccullough@apple.com>
73 <rdar://problem/5770054> JavaScript profiler (10928)
74 - Expose the new profiler functions to the WebInspector.
78 2008-05-14 Kevin McCullough <kmccullough@apple.com>
80 Giving credit where credit is due.
84 2008-05-14 Kevin McCullough <kmccullough@apple.com>
86 Reviewed by Geoff and Sam.
88 <rdar://problem/5770054> JavaScript profiler (10928)
89 Add the ability to get percentages of total and self time for displaying
93 (KJS::Profile::totalProfileTime):
94 * profiler/ProfileNode.cpp:
95 (KJS::ProfileNode::totalPercent):
96 (KJS::ProfileNode::selfPercent):
97 * profiler/ProfileNode.h:
98 * profiler/Profiler.h:
99 (KJS::Profiler::currentProfile):
101 2008-05-14 Kevin McCullough <kmccullough@apple.com>
105 <rdar://problem/5770054> JavaScript profiler (10928)
106 - Rename FunctionCallProfile to ProfileNode.
109 * JavaScriptCore.exp:
110 * JavaScriptCore.pri:
111 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
112 * JavaScriptCore.xcodeproj/project.pbxproj:
113 * JavaScriptCoreSources.bkl:
114 * profiler/FunctionCallProfile.cpp: Removed.
115 * profiler/FunctionCallProfile.h: Removed.
116 * profiler/Profile.cpp:
117 (KJS::Profile::Profile):
118 (KJS::Profile::willExecute):
119 * profiler/Profile.h:
120 (KJS::Profile::callTree):
121 * profiler/ProfileNode.cpp: Copied from profiler/FunctionCallProfile.cpp.
122 (KJS::ProfileNode::ProfileNode):
123 (KJS::ProfileNode::willExecute):
124 (KJS::ProfileNode::didExecute):
125 (KJS::ProfileNode::addChild):
126 (KJS::ProfileNode::findChild):
127 (KJS::ProfileNode::stopProfiling):
128 (KJS::ProfileNode::selfTime):
129 (KJS::ProfileNode::printDataInspectorStyle):
130 (KJS::ProfileNode::printDataSampleStyle):
131 (KJS::ProfileNode::endAndRecordCall):
132 * profiler/ProfileNode.h: Copied from profiler/FunctionCallProfile.h.
133 (KJS::ProfileNode::create):
134 (KJS::ProfileNode::children):
135 * profiler/Profiler.cpp:
137 2008-05-14 Kevin McCullough <kmccullough@apple.com>
141 <rdar://problem/5770054> JavaScript profiler (10928)
142 - Have each FunctionCallProfile be able to return it's total and self time.
144 * JavaScriptCore.exp:
145 * profiler/FunctionCallProfile.cpp:
146 (KJS::FunctionCallProfile::selfTime):
147 * profiler/FunctionCallProfile.h:
148 (KJS::FunctionCallProfile::totalTime):
150 2008-05-14 Alexey Proskuryakov <ap@webkit.org>
154 <rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.
156 <https://bugs.webkit.org/show_bug.cgi?id=4931>
157 Unicode format characters (Cf) should be removed from JavaScript source
159 Of all Cf characters, we are only removing BOM, because this is what Firefox trunk has
160 settled upon, after extensive discussion and investigation.
162 Based on Darin's work on this bug.
164 Test: fast/js/removing-Cf-characters.html
167 (KJS::Lexer::setCode): Tweak formatting. Use a call to shift(4) to read in the
168 first characters, instead of having special case code here.
169 (KJS::Lexer::shift): Add a loop when reading a character to skip BOM characters.
171 2008-05-13 Matt Lilek <webkit@mattlilek.com>
173 Not reviewed, build fix.
175 * kjs/date_object.cpp:
176 (KJS::DateObjectFuncImp::callAsFunction):
178 2008-05-13 Anders Carlsson <andersca@apple.com>
182 <rdar://problem/5933644> Implement Date.now
184 Implement Date.now which returns the number of milliseconds since the epoch.
186 * kjs/CommonIdentifiers.h:
187 * kjs/date_object.cpp:
188 (KJS::DateObjectFuncImp::):
189 (KJS::DateObjectImp::DateObjectImp):
190 (KJS::DateObjectFuncImp::callAsFunction):
192 2008-05-13 Kevin McCullough <kmccullough@apple.com>
194 Giving credit where credit is due.
198 2008-05-13 Kevin McCullough <kmccullough@apple.com>
200 Reviewed by Adam and Geoff.
202 <rdar://problem/5770054> JavaScript profiler (10928)
203 Use PassRefPtrs instead of RefPtrs when appropriate.
205 * profiler/FunctionCallProfile.cpp:
206 (KJS::FunctionCallProfile::addChild):
207 * profiler/FunctionCallProfile.h:
208 * profiler/Profile.h:
209 (KJS::Profile::callTree):
211 2008-05-13 Kevin McCullough <kmccullough@apple.com>
215 <rdar://problem/5770054> JavaScript profiler (10928)
216 - Made some functions static (as per Adam) and changed from using raw
217 pointers to RefPtr for making these JavaScript Objects.
219 * profiler/FunctionCallProfile.cpp:
220 (KJS::FunctionCallProfile::addChild):
221 (KJS::FunctionCallProfile::findChild):
222 * profiler/FunctionCallProfile.h:
223 (KJS::FunctionCallProfile::create):
224 * profiler/Profile.cpp:
225 (KJS::Profile::Profile):
226 (KJS::Profile::willExecute):
227 (KJS::Profile::didExecute):
228 (KJS::functionNameCountPairComparator):
229 * profiler/Profile.h:
230 (KJS::Profile::create):
231 (KJS::Profile::title):
232 (KJS::Profile::callTree):
233 * profiler/Profiler.cpp:
234 (KJS::Profiler::startProfiling):
235 * profiler/Profiler.h:
236 (KJS::Profiler::allProfiles):
237 (KJS::Profiler::clearProfiles):
239 2008-05-13 Alexey Proskuryakov <ap@webkit.org>
241 Reviewed by Geoffrey Garen.
243 <rdar://problem/4949018> JavaScriptCore API claims to work with UTF8 strings, but only works
248 (KJS::UString::Rep::createFromUTF8):
249 Added. Implementation adapted from JSStringCreateWithUTF8CString().
251 * API/JSStringRef.cpp:
252 (JSStringCreateWithUTF8CString):
253 * API/JSClassRef.cpp:
254 (OpaqueJSClass::OpaqueJSClass):
255 Use UString::Rep::createFromUTF8().
257 2008-05-12 Mark Rowe <mrowe@apple.com>
259 Reviewed by Tim Hatcher.
261 <rdar://problem/4859666> WebKit needs availability macros in order to deprecate APIs
263 Create WebKit availability macros that key off the Mac OS X version being targeted to
264 determine the WebKit version being targeted. Applications can define
265 WEBKIT_VERSION_MIN_REQUIRED before including WebKit headers in order to target a specific
268 The availability header is being added to JavaScriptCore rather than WebKit as JavaScriptCore
269 is the lowest-level portion of the public WebKit API.
271 * API/WebKitAvailability.h: Added.
272 * JavaScriptCore.xcodeproj/project.pbxproj:
274 2008-05-12 Alexey Proskuryakov <ap@webkit.org>
278 https://bugs.webkit.org/show_bug.cgi?id=18828
279 Reproducible crash with PAC file
281 Naively moving JavaScriptCore into thread-specific data was inappropriate in the face of
282 exiting JavaScriptCore API clients, which expect a different therading model. Temporarily
283 disabling ThreadSpecific implementation until this can be sorted out.
285 * wtf/ThreadSpecific.h:
286 (WTF::::ThreadSpecific):
287 (WTF::::~ThreadSpecific):
291 2008-05-12 Alexey Proskuryakov <ap@webkit.org>
293 Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
294 SquirrelFish merging.
298 * API/JSCallbackObjectFunctions.h:
299 (KJS::::staticFunctionGetter):
300 * API/JSClassRef.cpp:
301 (OpaqueJSClass::prototype):
302 * API/JSObjectRef.cpp:
304 (JSObjectMakeFunctionWithCallback):
305 (JSObjectMakeConstructor):
306 (JSObjectMakeFunction):
307 * API/JSValueRef.cpp:
310 * JavaScriptCore.exp:
312 * kjs/InitializeThreading.cpp:
313 (KJS::initializeThreadingOnce):
314 * kjs/JSGlobalObject.cpp:
315 (KJS::JSGlobalObject::~JSGlobalObject):
316 (KJS::JSGlobalObject::init):
317 (KJS::JSGlobalObject::put):
318 (KJS::JSGlobalObject::reset):
319 (KJS::JSGlobalObject::tearOffActivation):
320 * kjs/JSGlobalObject.h:
321 (KJS::JSGlobalObject::head):
322 (KJS::JSGlobalObject::perThreadData):
324 (KJS::JSLock::registerThread):
326 (KJS::JSLock::JSLock):
327 * kjs/array_instance.cpp:
328 (KJS::ArrayInstance::ArrayInstance):
329 (KJS::ArrayInstance::lengthGetter):
330 * kjs/array_object.cpp:
331 (KJS::arrayProtoFuncToString):
332 (KJS::arrayProtoFuncToLocaleString):
333 (KJS::arrayProtoFuncJoin):
334 (KJS::arrayProtoFuncConcat):
335 (KJS::arrayProtoFuncPop):
336 (KJS::arrayProtoFuncPush):
337 (KJS::arrayProtoFuncShift):
338 (KJS::arrayProtoFuncSlice):
339 (KJS::arrayProtoFuncSplice):
340 (KJS::arrayProtoFuncUnShift):
341 (KJS::arrayProtoFuncFilter):
342 (KJS::arrayProtoFuncMap):
343 (KJS::arrayProtoFuncEvery):
344 (KJS::arrayProtoFuncForEach):
345 (KJS::arrayProtoFuncSome):
346 (KJS::arrayProtoFuncIndexOf):
347 (KJS::arrayProtoFuncLastIndexOf):
348 (KJS::ArrayObjectImp::ArrayObjectImp):
349 (KJS::ArrayObjectImp::construct):
350 * kjs/bool_object.cpp:
351 (KJS::BooleanPrototype::BooleanPrototype):
352 (KJS::booleanProtoFuncToString):
353 (KJS::BooleanObjectImp::BooleanObjectImp):
354 (KJS::BooleanObjectImp::construct):
357 (KJS::allocateBlock):
358 (KJS::Collector::recordExtraCost):
359 (KJS::Collector::heapAllocate):
360 (KJS::Collector::allocate):
361 (KJS::Collector::allocateNumber):
362 (KJS::Collector::registerAsMainThread):
364 (KJS::PlatformThread::PlatformThread):
365 (KJS::getCurrentPlatformThread):
366 (KJS::Collector::Thread::Thread):
367 (KJS::destroyRegisteredThread):
368 (KJS::initializeRegisteredThreadKey):
369 (KJS::Collector::registerThread):
370 (KJS::Collector::markStackObjectsConservatively):
371 (KJS::Collector::markCurrentThreadConservativelyInternal):
372 (KJS::Collector::markCurrentThreadConservatively):
373 (KJS::suspendThread):
375 (KJS::getPlatformThreadRegisters):
376 (KJS::otherThreadStackPointer):
377 (KJS::Collector::markOtherThreadConservatively):
378 (KJS::protectedValues):
379 (KJS::Collector::protect):
380 (KJS::Collector::unprotect):
381 (KJS::Collector::collectOnMainThreadOnly):
382 (KJS::Collector::markProtectedObjects):
383 (KJS::Collector::markMainThreadOnlyObjects):
384 (KJS::Collector::sweep):
385 (KJS::Collector::collect):
386 (KJS::Collector::size):
387 (KJS::Collector::globalObjectCount):
388 (KJS::Collector::protectedGlobalObjectCount):
389 (KJS::Collector::protectedObjectCount):
390 (KJS::Collector::protectedObjectTypeCounts):
391 (KJS::Collector::isBusy):
392 (KJS::Collector::reportOutOfMemoryToAllExecStates):
395 (KJS::Collector::cellBlock):
396 (KJS::Collector::cellOffset):
397 (KJS::Collector::isCellMarked):
398 (KJS::Collector::markCell):
399 (KJS::Collector::reportExtraMemoryCost):
400 * kjs/date_object.cpp:
401 (KJS::formatLocaleDate):
402 (KJS::DatePrototype::DatePrototype):
403 (KJS::DateObjectImp::DateObjectImp):
404 (KJS::DateObjectImp::construct):
405 (KJS::DateObjectImp::callAsFunction):
406 (KJS::DateObjectFuncImp::DateObjectFuncImp):
407 (KJS::DateObjectFuncImp::callAsFunction):
408 (KJS::dateProtoFuncToString):
409 (KJS::dateProtoFuncToUTCString):
410 (KJS::dateProtoFuncToDateString):
411 (KJS::dateProtoFuncToTimeString):
412 (KJS::dateProtoFuncToLocaleString):
413 (KJS::dateProtoFuncToLocaleDateString):
414 (KJS::dateProtoFuncToLocaleTimeString):
415 (KJS::dateProtoFuncValueOf):
416 (KJS::dateProtoFuncGetTime):
417 (KJS::dateProtoFuncGetFullYear):
418 (KJS::dateProtoFuncGetUTCFullYear):
419 (KJS::dateProtoFuncToGMTString):
420 (KJS::dateProtoFuncGetMonth):
421 (KJS::dateProtoFuncGetUTCMonth):
422 (KJS::dateProtoFuncGetDate):
423 (KJS::dateProtoFuncGetUTCDate):
424 (KJS::dateProtoFuncGetDay):
425 (KJS::dateProtoFuncGetUTCDay):
426 (KJS::dateProtoFuncGetHours):
427 (KJS::dateProtoFuncGetUTCHours):
428 (KJS::dateProtoFuncGetMinutes):
429 (KJS::dateProtoFuncGetUTCMinutes):
430 (KJS::dateProtoFuncGetSeconds):
431 (KJS::dateProtoFuncGetUTCSeconds):
432 (KJS::dateProtoFuncGetMilliSeconds):
433 (KJS::dateProtoFuncGetUTCMilliseconds):
434 (KJS::dateProtoFuncGetTimezoneOffset):
435 (KJS::dateProtoFuncSetTime):
436 (KJS::setNewValueFromTimeArgs):
437 (KJS::setNewValueFromDateArgs):
438 (KJS::dateProtoFuncSetYear):
439 (KJS::dateProtoFuncGetYear):
440 * kjs/error_object.cpp:
441 (KJS::ErrorPrototype::ErrorPrototype):
442 (KJS::errorProtoFuncToString):
443 (KJS::ErrorObjectImp::ErrorObjectImp):
444 (KJS::ErrorObjectImp::construct):
445 (KJS::NativeErrorPrototype::NativeErrorPrototype):
446 (KJS::NativeErrorImp::NativeErrorImp):
447 (KJS::NativeErrorImp::construct):
449 (KJS::FunctionImp::lengthGetter):
450 (KJS::FunctionImp::construct):
451 (KJS::Arguments::Arguments):
452 (KJS::ActivationImp::createArgumentsObject):
455 (KJS::globalFuncParseInt):
456 (KJS::globalFuncParseFloat):
457 (KJS::globalFuncEscape):
458 (KJS::globalFuncUnescape):
459 (KJS::PrototypeFunction::PrototypeFunction):
460 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
461 * kjs/function_object.cpp:
462 (KJS::FunctionPrototype::FunctionPrototype):
463 (KJS::functionProtoFuncToString):
464 (KJS::FunctionObjectImp::FunctionObjectImp):
465 (KJS::FunctionObjectImp::construct):
467 (KJS::StringImp::toObject):
469 (KJS::StringImp::StringImp):
470 (KJS::NumberImp::operator new):
472 (KJS::List::markSet):
473 (KJS::List::markProtectedListsSlowCase):
474 (KJS::List::expandAndAppend):
478 (KJS::List::markProtectedLists):
480 (KJS::staticFunctionGetter):
481 (KJS::cacheGlobalObject):
482 * kjs/math_object.cpp:
483 (KJS::MathObjectImp::getValueProperty):
484 (KJS::mathProtoFuncAbs):
485 (KJS::mathProtoFuncACos):
486 (KJS::mathProtoFuncASin):
487 (KJS::mathProtoFuncATan):
488 (KJS::mathProtoFuncATan2):
489 (KJS::mathProtoFuncCeil):
490 (KJS::mathProtoFuncCos):
491 (KJS::mathProtoFuncExp):
492 (KJS::mathProtoFuncFloor):
493 (KJS::mathProtoFuncLog):
494 (KJS::mathProtoFuncMax):
495 (KJS::mathProtoFuncMin):
496 (KJS::mathProtoFuncPow):
497 (KJS::mathProtoFuncRandom):
498 (KJS::mathProtoFuncRound):
499 (KJS::mathProtoFuncSin):
500 (KJS::mathProtoFuncSqrt):
501 (KJS::mathProtoFuncTan):
503 (KJS::ParserRefCounted::ParserRefCounted):
504 (KJS::ParserRefCounted::ref):
505 (KJS::ParserRefCounted::deref):
506 (KJS::ParserRefCounted::refcount):
507 (KJS::ParserRefCounted::deleteNewObjects):
508 (KJS::Node::handleException):
509 (KJS::NumberNode::evaluate):
510 (KJS::StringNode::evaluate):
511 (KJS::ArrayNode::evaluate):
512 (KJS::PostIncResolveNode::evaluate):
513 (KJS::PostIncLocalVarNode::evaluate):
514 (KJS::PostDecResolveNode::evaluate):
515 (KJS::PostDecLocalVarNode::evaluate):
516 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
517 (KJS::PostIncBracketNode::evaluate):
518 (KJS::PostDecBracketNode::evaluate):
519 (KJS::PostIncDotNode::evaluate):
520 (KJS::PostDecDotNode::evaluate):
521 (KJS::typeStringForValue):
522 (KJS::LocalVarTypeOfNode::evaluate):
523 (KJS::TypeOfResolveNode::evaluate):
524 (KJS::TypeOfValueNode::evaluate):
525 (KJS::PreIncLocalVarNode::evaluate):
526 (KJS::PreIncResolveNode::evaluate):
527 (KJS::PreDecLocalVarNode::evaluate):
528 (KJS::PreDecResolveNode::evaluate):
529 (KJS::PreIncConstNode::evaluate):
530 (KJS::PreDecConstNode::evaluate):
531 (KJS::PostIncConstNode::evaluate):
532 (KJS::PostDecConstNode::evaluate):
533 (KJS::PreIncBracketNode::evaluate):
534 (KJS::PreDecBracketNode::evaluate):
535 (KJS::PreIncDotNode::evaluate):
536 (KJS::PreDecDotNode::evaluate):
537 (KJS::NegateNode::evaluate):
538 (KJS::BitwiseNotNode::evaluate):
539 (KJS::MultNode::evaluate):
540 (KJS::DivNode::evaluate):
541 (KJS::ModNode::evaluate):
544 (KJS::AddNumbersNode::evaluate):
545 (KJS::AddStringsNode::evaluate):
546 (KJS::AddStringLeftNode::evaluate):
547 (KJS::AddStringRightNode::evaluate):
548 (KJS::SubNode::evaluate):
549 (KJS::LeftShiftNode::evaluate):
550 (KJS::RightShiftNode::evaluate):
551 (KJS::UnsignedRightShiftNode::evaluate):
552 (KJS::BitXOrNode::evaluate):
553 (KJS::BitOrNode::evaluate):
554 (KJS::valueForReadModifyAssignment):
555 (KJS::ForInNode::execute):
556 (KJS::TryNode::execute):
557 (KJS::FuncDeclNode::makeFunction):
558 (KJS::FuncExprNode::evaluate):
560 * kjs/number_object.cpp:
561 (KJS::NumberPrototype::NumberPrototype):
562 (KJS::numberProtoFuncToString):
563 (KJS::numberProtoFuncToLocaleString):
564 (KJS::numberProtoFuncToFixed):
565 (KJS::numberProtoFuncToExponential):
566 (KJS::numberProtoFuncToPrecision):
567 (KJS::NumberObjectImp::NumberObjectImp):
568 (KJS::NumberObjectImp::getValueProperty):
569 (KJS::NumberObjectImp::construct):
570 (KJS::NumberObjectImp::callAsFunction):
572 (KJS::JSObject::call):
573 (KJS::JSObject::get):
574 (KJS::JSObject::put):
575 (KJS::JSObject::defineGetter):
576 (KJS::JSObject::defineSetter):
577 (KJS::JSObject::putDirect):
578 (KJS::Error::create):
580 * kjs/object_object.cpp:
581 (KJS::ObjectPrototype::ObjectPrototype):
582 (KJS::objectProtoFuncToLocaleString):
583 (KJS::objectProtoFuncToString):
584 (KJS::ObjectObjectImp::ObjectObjectImp):
585 (KJS::ObjectObjectImp::construct):
586 * kjs/property_map.h:
587 (KJS::SavedProperty::SavedProperty):
588 (KJS::SavedProperty::init):
589 (KJS::SavedProperty::~SavedProperty):
590 (KJS::SavedProperty::name):
591 (KJS::SavedProperty::value):
592 (KJS::SavedProperty::attributes):
596 * kjs/regexp_object.cpp:
597 (KJS::RegExpPrototype::RegExpPrototype):
598 (KJS::regExpProtoFuncToString):
599 (KJS::RegExpImp::getValueProperty):
600 (KJS::RegExpObjectImp::RegExpObjectImp):
601 (KJS::RegExpObjectImp::arrayOfMatches):
602 (KJS::RegExpObjectImp::getBackref):
603 (KJS::RegExpObjectImp::getLastParen):
604 (KJS::RegExpObjectImp::getLeftContext):
605 (KJS::RegExpObjectImp::getRightContext):
606 (KJS::RegExpObjectImp::getValueProperty):
607 (KJS::RegExpObjectImp::createRegExpImp):
608 * kjs/regexp_object.h:
609 * kjs/string_object.cpp:
610 (KJS::StringInstance::StringInstance):
611 (KJS::StringInstance::lengthGetter):
612 (KJS::StringInstance::indexGetter):
613 (KJS::stringInstanceNumericPropertyGetter):
614 (KJS::StringPrototype::StringPrototype):
616 (KJS::stringProtoFuncCharAt):
617 (KJS::stringProtoFuncCharCodeAt):
618 (KJS::stringProtoFuncConcat):
619 (KJS::stringProtoFuncIndexOf):
620 (KJS::stringProtoFuncLastIndexOf):
621 (KJS::stringProtoFuncMatch):
622 (KJS::stringProtoFuncSearch):
623 (KJS::stringProtoFuncReplace):
624 (KJS::stringProtoFuncSlice):
625 (KJS::stringProtoFuncSplit):
626 (KJS::stringProtoFuncSubstr):
627 (KJS::stringProtoFuncSubstring):
628 (KJS::stringProtoFuncToLowerCase):
629 (KJS::stringProtoFuncToUpperCase):
630 (KJS::stringProtoFuncToLocaleLowerCase):
631 (KJS::stringProtoFuncToLocaleUpperCase):
632 (KJS::stringProtoFuncLocaleCompare):
633 (KJS::stringProtoFuncBig):
634 (KJS::stringProtoFuncSmall):
635 (KJS::stringProtoFuncBlink):
636 (KJS::stringProtoFuncBold):
637 (KJS::stringProtoFuncFixed):
638 (KJS::stringProtoFuncItalics):
639 (KJS::stringProtoFuncStrike):
640 (KJS::stringProtoFuncSub):
641 (KJS::stringProtoFuncSup):
642 (KJS::stringProtoFuncFontcolor):
643 (KJS::stringProtoFuncFontsize):
644 (KJS::stringProtoFuncAnchor):
645 (KJS::stringProtoFuncLink):
646 (KJS::StringObjectImp::StringObjectImp):
647 (KJS::StringObjectImp::construct):
648 (KJS::StringObjectImp::callAsFunction):
649 (KJS::StringObjectFuncImp::StringObjectFuncImp):
650 (KJS::StringObjectFuncImp::callAsFunction):
651 * kjs/string_object.h:
652 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
654 (GlobalObject::GlobalObject):
661 (KJS::JSCell::operator new):
663 (KJS::jsOwnedString):
668 (KJS::jsNumberFromAnd):
669 (KJS::JSCell::marked):
671 (KJS::JSValue::toJSNumber):
672 * wtf/ThreadSpecific.h:
675 2008-05-10 Julien Chaffraix <jchaffraix@webkit.org>
679 * JavaScriptCore.pri: Add profiler/Profile.cpp.
680 * JavaScriptCoreSources.bkl: Ditto.
682 2008-05-10 Jan Michael Alonzo <jmalonzo@unpluggable.com>
688 * GNUmakefile.am: Add Profile.cpp in _sources
690 2008-05-09 Brady Eidson <beidson@apple.com>
692 Build Fix. Kevin is an idiot.
693 ("My name is Kevin McCullough and I approve this message.")
695 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
697 2008-05-09 Kevin McCullough <kmccullough@apple.com>
701 -<rdar://problem/5770054> JavaScript profiler (10928)
702 -Add Profile class so that all profiles can be stored and retrieved by
703 the WebInspector when that time comes.
705 * JavaScriptCore.exp: Export the new function signatures.
706 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the
708 * profiler/Profile.cpp: Added. This class represents a single run of the
710 (KJS::Profile::Profile):
711 (KJS::Profile::willExecute):
712 (KJS::Profile::didExecute):
713 (KJS::Profile::printDataInspectorStyle):
714 (KJS::functionNameCountPairComparator):
715 (KJS::Profile::printDataSampleStyle):
716 * profiler/Profile.h: Added. Ditto
717 (KJS::Profile::stopProfiling):
718 * profiler/Profiler.cpp: Now the profiler keeps track of many profiles
719 but only runs one at a time.
720 (KJS::Profiler::startProfiling):
721 (KJS::Profiler::stopProfiling):
722 (KJS::Profiler::willExecute):
723 (KJS::Profiler::didExecute):
724 (KJS::Profiler::printDataInspectorStyle):
725 (KJS::Profiler::printDataSampleStyle):
726 * profiler/Profiler.h: Ditto.
727 (KJS::Profiler::~Profiler):
728 (KJS::Profiler::allProfiles):
729 (KJS::Profiler::clearProfiles):
731 2008-05-08 Anders Carlsson <andersca@apple.com>
735 Enable NPAPI plug-ins on 64-bit.
739 2008-05-07 Julien Chaffraix <jchaffraix@webkit.org>
741 Reviewed by Adam Roben.
745 Add SIZE_MAX definition for the wx port.
749 2008-05-07 Ariya Hidayat <ariya.hidayat@trolltech.com>
753 Support for isMainThread in the Qt port.
755 * wtf/ThreadingQt.cpp:
756 (WTF::initializeThreading): Adjusted.
757 (WTF::isMainThread): Added.
759 2008-05-05 Darin Adler <darin@apple.com>
761 Reviewed by John Sullivan.
763 - fix debug-only leak seen on buildbot
766 (WTF::HashTable::checkKey): After writing an empty value in, but before constructing a
767 deleted value on top of it, call the destructor so the empty value doesn't leak.
769 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
771 Reviewed by Geoffrey Garen.
773 Get rid of static data in nodes.cpp (well, at least of non-debug one).
775 No measurable change on SunSpider.
777 * kjs/InitializeThreading.cpp:
778 (KJS::initializeThreadingOnce):
780 (KJS::newTrackedObjects):
781 (KJS::trackedObjectExtraRefCounts):
782 (KJS::initializeNodesThreading):
783 (KJS::ParserRefCounted::ParserRefCounted):
784 (KJS::ParserRefCounted::ref):
785 (KJS::ParserRefCounted::deref):
786 (KJS::ParserRefCounted::refcount):
787 (KJS::ParserRefCounted::deleteNewObjects):
789 Made newTrackedObjects and trackedObjectExtraRefCounts per-thread.
791 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
795 Move call stack depth counter to global object.
797 * kjs/ExecState.h: (KJS::ExecState::functionCallDepth): Added a recursion depth counter to
799 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Initialize PerThreadData.functionCallDepth.
800 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::perThreadData): Made the result non-const.
803 (KJS::throwStackSizeExceededError): Moved throwError to a separate function, since it is now
804 the only thing in JSObject::call that needs a PIC branch.
805 (KJS::JSObject::call): Use a per-thread variable instead of local static for recursion depth
808 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
812 Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
813 for the sake of non-WebKit clients.
817 * API/JSContextRef.cpp:
818 (JSGlobalContextCreate):
819 These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
820 and JSClassRef functions that can be called earlier, but they do not do anything that
821 requires initializeThreading.
823 * kjs/InitializeThreading.cpp:
824 (KJS::doInitializeThreading):
825 (KJS::initializeThreading):
826 On Darwin, make the initialization happen under pthread_once, since there is no guarantee
827 that non-WebKit clients won't try to call this function re-entrantly.
829 * kjs/InitializeThreading.h:
831 Spell out initializeThreading contract.
833 * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
834 Darwin, even if threading was initialized from a secondary thread.
836 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
838 Reviewed by Geoffrey Garen.
840 https://bugs.webkit.org/show_bug.cgi?id=18826
841 Make JavaScript heap per-thread
843 * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
844 (replaced "new T" with "new T()").
846 * kjs/collector.h: Renamed Collector to Heap, made the heap per-thread. Removed support for
847 multithreaded access to a heap.
848 (KJS::CollectorBlock): Removed collectOnMainThreadOnly bitmap, added a reference to owner heap.
849 (KJS::SmallCellCollectorBlock): Ditto.
850 (KJS::Heap::markListSet): Moved from a static variable in List.cpp to a per-thread one here.
851 (KJS::Heap::heap): Added a method to find which heap a JSValue is allocated in.
853 * kjs/collector.cpp: Changed "const size_t" constants to #defines, to avoid a PIC branch
854 (gcc was using one to access a constant used in std::max(), because it takes a reference,
855 even though std::max() itself was inlined).
856 (KJS::Heap::threadHeap): JS heap is now per-thread.
857 (KJS::Heap::Heap): Zero-initialize the heap.
858 (KJS::allocateBlock): Added NEVER_INLINE, because this function uses a PIC branch, so
859 inlining it in Heap::heapAllocate() is bad for performance, now that the latter doesn't
861 (KJS::Heap::heapAllocate): Initialize Block::heap.
862 (KJS::Heap::markCurrentThreadConservatively): Moved into markStackObjectsConservatively(),
863 as GC only works with a current thread's heap now.
864 (KJS::Heap::sweep): Removed collectOnMainThreadOnly checks.
865 (KJS::Heap::collect): Ditto.
869 (KJS::JSLock::JSLock):
870 Removed registerThread(), as the heap no longer cares.
872 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize new per-thread
873 variables in Heap and JSGlobalObject.
875 * kjs/ExecState.h: (KJS::ExecState::heap): Added a heap pointer for faster access to
876 per-thread heap, and an accessor for it.
878 * kjs/JSGlobalObject.h: Made JSGlobalObject linked list per-thread.
879 * kjs/JSGlobalObject.cpp:
880 (KJS::JSGlobalObject::~JSGlobalObject): Fixed a bug in linked list handling. It only worked
881 right if the removed object was the head one!
882 (KJS::JSGlobalObject::head): Return a per-thread list head.
883 (KJS::JSGlobalObject::init): Store a reference to per-thread heap.
884 (KJS::JSGlobalObject::reset): Pass ExecState to functions that need it.
885 (KJS::JSGlobalObject::tearOffActivation): Ditto.
886 (KJS::JSGlobalObject::operator new): JSGlobalObject allocation cannot use an ExecState,
887 so it needs a custom operator new that directly accesses per-thread heap.
890 (KJS::List::List): Replaced m_isInMarkSet boolean with an actual pointer to the set, since it
891 is no longer a single static object.
892 (KJS::List::~List): Ditto.
894 (KJS::List::markSet): Removed, this is now stored in Heap.
895 (KJS::List::markProtectedLists): Take a reference to the list.
896 (KJS::List::expandAndAppend): Ask the current thread heap for a mark set reference.
901 Use the newly added Heap::heap() method to find out which heap the value to be (un)protected
904 * kjs/property_map.h: Removed unused SavedProperty class.
906 * JavaScriptCore.exp:
909 * API/JSCallbackObjectFunctions.h:
910 (KJS::::staticFunctionGetter):
911 * API/JSClassRef.cpp:
912 (OpaqueJSClass::prototype):
913 * API/JSObjectRef.cpp:
915 (JSObjectMakeFunctionWithCallback):
916 (JSObjectMakeConstructor):
917 (JSObjectMakeFunction):
918 * API/JSValueRef.cpp:
921 * kjs/array_instance.cpp:
922 (KJS::ArrayInstance::ArrayInstance):
923 (KJS::ArrayInstance::lengthGetter):
924 * kjs/array_object.cpp:
925 (KJS::arrayProtoFuncToString):
926 (KJS::arrayProtoFuncToLocaleString):
927 (KJS::arrayProtoFuncJoin):
928 (KJS::arrayProtoFuncConcat):
929 (KJS::arrayProtoFuncPop):
930 (KJS::arrayProtoFuncPush):
931 (KJS::arrayProtoFuncShift):
932 (KJS::arrayProtoFuncSlice):
933 (KJS::arrayProtoFuncSplice):
934 (KJS::arrayProtoFuncUnShift):
935 (KJS::arrayProtoFuncFilter):
936 (KJS::arrayProtoFuncMap):
937 (KJS::arrayProtoFuncEvery):
938 (KJS::arrayProtoFuncForEach):
939 (KJS::arrayProtoFuncSome):
940 (KJS::arrayProtoFuncIndexOf):
941 (KJS::arrayProtoFuncLastIndexOf):
942 (KJS::ArrayObjectImp::ArrayObjectImp):
943 (KJS::ArrayObjectImp::construct):
944 * kjs/bool_object.cpp:
945 (KJS::BooleanPrototype::BooleanPrototype):
946 (KJS::booleanProtoFuncToString):
947 (KJS::BooleanObjectImp::BooleanObjectImp):
948 (KJS::BooleanObjectImp::construct):
949 * kjs/date_object.cpp:
950 (KJS::formatLocaleDate):
951 (KJS::DatePrototype::DatePrototype):
952 (KJS::DateObjectImp::DateObjectImp):
953 (KJS::DateObjectImp::construct):
954 (KJS::DateObjectImp::callAsFunction):
955 (KJS::DateObjectFuncImp::DateObjectFuncImp):
956 (KJS::DateObjectFuncImp::callAsFunction):
957 (KJS::dateProtoFuncToString):
958 (KJS::dateProtoFuncToUTCString):
959 (KJS::dateProtoFuncToDateString):
960 (KJS::dateProtoFuncToTimeString):
961 (KJS::dateProtoFuncToLocaleString):
962 (KJS::dateProtoFuncToLocaleDateString):
963 (KJS::dateProtoFuncToLocaleTimeString):
964 (KJS::dateProtoFuncValueOf):
965 (KJS::dateProtoFuncGetTime):
966 (KJS::dateProtoFuncGetFullYear):
967 (KJS::dateProtoFuncGetUTCFullYear):
968 (KJS::dateProtoFuncToGMTString):
969 (KJS::dateProtoFuncGetMonth):
970 (KJS::dateProtoFuncGetUTCMonth):
971 (KJS::dateProtoFuncGetDate):
972 (KJS::dateProtoFuncGetUTCDate):
973 (KJS::dateProtoFuncGetDay):
974 (KJS::dateProtoFuncGetUTCDay):
975 (KJS::dateProtoFuncGetHours):
976 (KJS::dateProtoFuncGetUTCHours):
977 (KJS::dateProtoFuncGetMinutes):
978 (KJS::dateProtoFuncGetUTCMinutes):
979 (KJS::dateProtoFuncGetSeconds):
980 (KJS::dateProtoFuncGetUTCSeconds):
981 (KJS::dateProtoFuncGetMilliSeconds):
982 (KJS::dateProtoFuncGetUTCMilliseconds):
983 (KJS::dateProtoFuncGetTimezoneOffset):
984 (KJS::dateProtoFuncSetTime):
985 (KJS::setNewValueFromTimeArgs):
986 (KJS::setNewValueFromDateArgs):
987 (KJS::dateProtoFuncSetYear):
988 (KJS::dateProtoFuncGetYear):
989 * kjs/error_object.cpp:
990 (KJS::ErrorPrototype::ErrorPrototype):
991 (KJS::errorProtoFuncToString):
992 (KJS::ErrorObjectImp::ErrorObjectImp):
993 (KJS::ErrorObjectImp::construct):
994 (KJS::NativeErrorPrototype::NativeErrorPrototype):
995 (KJS::NativeErrorImp::NativeErrorImp):
996 (KJS::NativeErrorImp::construct):
998 (KJS::FunctionImp::lengthGetter):
999 (KJS::FunctionImp::construct):
1000 (KJS::Arguments::Arguments):
1001 (KJS::ActivationImp::createArgumentsObject):
1004 (KJS::globalFuncParseInt):
1005 (KJS::globalFuncParseFloat):
1006 (KJS::globalFuncEscape):
1007 (KJS::globalFuncUnescape):
1008 (KJS::PrototypeFunction::PrototypeFunction):
1009 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
1010 * kjs/function_object.cpp:
1011 (KJS::FunctionPrototype::FunctionPrototype):
1012 (KJS::functionProtoFuncToString):
1013 (KJS::FunctionObjectImp::FunctionObjectImp):
1014 (KJS::FunctionObjectImp::construct):
1016 (KJS::StringImp::toObject):
1018 (KJS::StringImp::StringImp):
1019 (KJS::NumberImp::operator new):
1021 (KJS::staticFunctionGetter):
1022 (KJS::cacheGlobalObject):
1023 * kjs/math_object.cpp:
1024 (KJS::MathObjectImp::getValueProperty):
1025 (KJS::mathProtoFuncAbs):
1026 (KJS::mathProtoFuncACos):
1027 (KJS::mathProtoFuncASin):
1028 (KJS::mathProtoFuncATan):
1029 (KJS::mathProtoFuncATan2):
1030 (KJS::mathProtoFuncCeil):
1031 (KJS::mathProtoFuncCos):
1032 (KJS::mathProtoFuncExp):
1033 (KJS::mathProtoFuncFloor):
1034 (KJS::mathProtoFuncLog):
1035 (KJS::mathProtoFuncMax):
1036 (KJS::mathProtoFuncMin):
1037 (KJS::mathProtoFuncPow):
1038 (KJS::mathProtoFuncRandom):
1039 (KJS::mathProtoFuncRound):
1040 (KJS::mathProtoFuncSin):
1041 (KJS::mathProtoFuncSqrt):
1042 (KJS::mathProtoFuncTan):
1044 (KJS::Node::handleException):
1045 (KJS::NumberNode::evaluate):
1046 (KJS::StringNode::evaluate):
1047 (KJS::ArrayNode::evaluate):
1048 (KJS::PostIncResolveNode::evaluate):
1049 (KJS::PostIncLocalVarNode::evaluate):
1050 (KJS::PostDecResolveNode::evaluate):
1051 (KJS::PostDecLocalVarNode::evaluate):
1052 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
1053 (KJS::PostIncBracketNode::evaluate):
1054 (KJS::PostDecBracketNode::evaluate):
1055 (KJS::PostIncDotNode::evaluate):
1056 (KJS::PostDecDotNode::evaluate):
1057 (KJS::typeStringForValue):
1058 (KJS::LocalVarTypeOfNode::evaluate):
1059 (KJS::TypeOfResolveNode::evaluate):
1060 (KJS::TypeOfValueNode::evaluate):
1061 (KJS::PreIncLocalVarNode::evaluate):
1062 (KJS::PreIncResolveNode::evaluate):
1063 (KJS::PreDecLocalVarNode::evaluate):
1064 (KJS::PreDecResolveNode::evaluate):
1065 (KJS::PreIncConstNode::evaluate):
1066 (KJS::PreDecConstNode::evaluate):
1067 (KJS::PostIncConstNode::evaluate):
1068 (KJS::PostDecConstNode::evaluate):
1069 (KJS::PreIncBracketNode::evaluate):
1070 (KJS::PreDecBracketNode::evaluate):
1071 (KJS::PreIncDotNode::evaluate):
1072 (KJS::PreDecDotNode::evaluate):
1073 (KJS::NegateNode::evaluate):
1074 (KJS::BitwiseNotNode::evaluate):
1075 (KJS::MultNode::evaluate):
1076 (KJS::DivNode::evaluate):
1077 (KJS::ModNode::evaluate):
1080 (KJS::AddNumbersNode::evaluate):
1081 (KJS::AddStringsNode::evaluate):
1082 (KJS::AddStringLeftNode::evaluate):
1083 (KJS::AddStringRightNode::evaluate):
1084 (KJS::SubNode::evaluate):
1085 (KJS::LeftShiftNode::evaluate):
1086 (KJS::RightShiftNode::evaluate):
1087 (KJS::UnsignedRightShiftNode::evaluate):
1088 (KJS::BitXOrNode::evaluate):
1089 (KJS::BitOrNode::evaluate):
1090 (KJS::valueForReadModifyAssignment):
1091 (KJS::ForInNode::execute):
1092 (KJS::TryNode::execute):
1093 (KJS::FuncDeclNode::makeFunction):
1094 (KJS::FuncExprNode::evaluate):
1095 * kjs/number_object.cpp:
1096 (KJS::NumberPrototype::NumberPrototype):
1097 (KJS::numberProtoFuncToString):
1098 (KJS::numberProtoFuncToLocaleString):
1099 (KJS::numberProtoFuncToFixed):
1100 (KJS::numberProtoFuncToExponential):
1101 (KJS::numberProtoFuncToPrecision):
1102 (KJS::NumberObjectImp::NumberObjectImp):
1103 (KJS::NumberObjectImp::getValueProperty):
1104 (KJS::NumberObjectImp::construct):
1105 (KJS::NumberObjectImp::callAsFunction):
1107 (KJS::JSObject::defineGetter):
1108 (KJS::JSObject::defineSetter):
1109 (KJS::JSObject::putDirect):
1110 (KJS::Error::create):
1112 * kjs/object_object.cpp:
1113 (KJS::ObjectPrototype::ObjectPrototype):
1114 (KJS::objectProtoFuncToLocaleString):
1115 (KJS::objectProtoFuncToString):
1116 (KJS::ObjectObjectImp::ObjectObjectImp):
1117 (KJS::ObjectObjectImp::construct):
1118 * kjs/regexp_object.cpp:
1119 (KJS::RegExpPrototype::RegExpPrototype):
1120 (KJS::regExpProtoFuncToString):
1121 (KJS::RegExpImp::getValueProperty):
1122 (KJS::RegExpObjectImp::RegExpObjectImp):
1123 (KJS::RegExpObjectImp::arrayOfMatches):
1124 (KJS::RegExpObjectImp::getBackref):
1125 (KJS::RegExpObjectImp::getLastParen):
1126 (KJS::RegExpObjectImp::getLeftContext):
1127 (KJS::RegExpObjectImp::getRightContext):
1128 (KJS::RegExpObjectImp::getValueProperty):
1129 (KJS::RegExpObjectImp::createRegExpImp):
1130 * kjs/regexp_object.h:
1131 * kjs/string_object.cpp:
1132 (KJS::StringInstance::StringInstance):
1133 (KJS::StringInstance::lengthGetter):
1134 (KJS::StringInstance::indexGetter):
1135 (KJS::stringInstanceNumericPropertyGetter):
1136 (KJS::StringPrototype::StringPrototype):
1138 (KJS::stringProtoFuncCharAt):
1139 (KJS::stringProtoFuncCharCodeAt):
1140 (KJS::stringProtoFuncConcat):
1141 (KJS::stringProtoFuncIndexOf):
1142 (KJS::stringProtoFuncLastIndexOf):
1143 (KJS::stringProtoFuncMatch):
1144 (KJS::stringProtoFuncSearch):
1145 (KJS::stringProtoFuncReplace):
1146 (KJS::stringProtoFuncSlice):
1147 (KJS::stringProtoFuncSplit):
1148 (KJS::stringProtoFuncSubstr):
1149 (KJS::stringProtoFuncSubstring):
1150 (KJS::stringProtoFuncToLowerCase):
1151 (KJS::stringProtoFuncToUpperCase):
1152 (KJS::stringProtoFuncToLocaleLowerCase):
1153 (KJS::stringProtoFuncToLocaleUpperCase):
1154 (KJS::stringProtoFuncLocaleCompare):
1155 (KJS::stringProtoFuncBig):
1156 (KJS::stringProtoFuncSmall):
1157 (KJS::stringProtoFuncBlink):
1158 (KJS::stringProtoFuncBold):
1159 (KJS::stringProtoFuncFixed):
1160 (KJS::stringProtoFuncItalics):
1161 (KJS::stringProtoFuncStrike):
1162 (KJS::stringProtoFuncSub):
1163 (KJS::stringProtoFuncSup):
1164 (KJS::stringProtoFuncFontcolor):
1165 (KJS::stringProtoFuncFontsize):
1166 (KJS::stringProtoFuncAnchor):
1167 (KJS::stringProtoFuncLink):
1168 (KJS::StringObjectImp::StringObjectImp):
1169 (KJS::StringObjectImp::construct):
1170 (KJS::StringObjectImp::callAsFunction):
1171 (KJS::StringObjectFuncImp::StringObjectFuncImp):
1172 (KJS::StringObjectFuncImp::callAsFunction):
1173 * kjs/string_object.h:
1174 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1176 (GlobalObject::GlobalObject):
1183 (KJS::JSCell::operator new):
1185 (KJS::jsOwnedString):
1186 (KJS::jsNumberCell):
1190 (KJS::jsNumberFromAnd):
1191 (KJS::JSCell::marked):
1192 (KJS::JSCell::mark):
1193 (KJS::JSValue::toJSNumber):
1194 Removed collectOnMainThreadOnly, as this is the only way to collect now. Replaced calls to
1195 static Collector methods with calls to per-thread Heap ones.
1197 2008-05-02 Dan Bernstein <mitz@apple.com>
1199 Reviewed by Maciej Stachowiak.
1203 * wtf/StrHash.h: Added header guards and removed #include "config.h".
1205 2008-05-01 Ada Chan <adachan@apple.com>
1207 #include <wtf/StrHash.h> in identifier.cpp.
1211 * kjs/identifier.cpp:
1213 2008-05-01 Steve Falkenburg <sfalken@apple.com>
1217 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1219 2008-05-01 Sam Weinig <sam@webkit.org>
1223 * JavaScriptCore.xcodeproj/project.pbxproj:
1225 2008-05-01 Kevin McCullough <kmccullough@apple.com>
1229 <rdar://problem/5770054> JavaScript profiler (10928)
1230 - Fix "sample" output so that it can be imported into Instruments
1231 - Also keep track of number of times a function is profiled.
1233 * JavaScriptCore.xcodeproj/project.pbxproj: Add StrHash.h which needed
1234 to be pulled out of identifier.cpp so that it could be used by the
1235 profiler and identifiers.
1236 * kjs/identifier.cpp: Ditto.
1237 * profiler/FunctionCallProfile.cpp:
1238 (KJS::FunctionCallProfile::printDataInspectorStyle): Inspector style
1239 printing should show microseconds.
1240 (KJS::FunctionCallProfile::printDataSampleStyle): Sample style printing
1241 now counts the number of times a function is in the stack tree and does
1242 not print microseconds since that does not make sense for a sampler.
1243 * profiler/FunctionCallProfile.h: Keep track of number of times a
1244 function is profiled.
1245 (KJS::FunctionCallProfile::numberOfCalls):
1246 * profiler/Profiler.cpp:
1247 (KJS::functionNameCountPairComparator): Comparator for sort function in
1248 printDataSampleStyle.
1249 (KJS::Profiler::printDataSampleStyle): Print the number of times that a
1250 function is listed in the stack tree in order of most times listed.
1251 * wtf/HashCountedSet.h: Added copyToVector since it didn't exist and is
1252 a more standard way to copy a HashSet to a Vector. I added on variant
1253 that takes a pair as the Vector's type and so the HashCountedSet simply
1254 fills in that pair with its internal pair, and another variant that
1255 takes a Vector of the type of the HashCountedSet and only fills in the
1256 Vector with the first element of the pair.
1257 (WTF::copyToVector):
1258 * wtf/StrHash.h: Added.
1261 2008-04-29 David Kilzer <ddkilzer@apple.com>
1263 BUILD FIX for ENABLE(DASHBOARD_SUPPORT)
1265 * wtf/Platform.h: Defined ENABLE(DASHBOARD_SUPPORT) to 1 only for
1266 PLATFORM(MAC) and PLATFORM(WIN). Changed default to 0 for other
1269 2008-04-29 Greg Bolsinga <bolsinga@apple.com>
1273 Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
1277 2008-04-29 Kevin McCullough <kmccullough@apple.com>
1281 -<rdar://problem/5770054> JavaScript profiler (10928)
1284 * profiler/FunctionCallProfile.cpp:
1285 (KJS::FunctionCallProfile::FunctionCallProfile):
1286 (KJS::FunctionCallProfile::didExecute): Implements call count and fixed a bug where a stackIndex
1287 of 0 was causing the assert to be hit.
1288 (KJS::FunctionCallProfile::stopProfiling):
1289 (KJS::FunctionCallProfile::endAndRecordCall):
1290 * profiler/FunctionCallProfile.h:
1292 2008-04-29 Simon Hausmann <hausmann@webkit.org>
1294 Qt/Windows build fix. The externally declared hash tables are actually
1295 declared const and the const is mangled in the symbol name, so when
1296 importing they also need to be marked const.
1298 When compiling without MULTIPLE_THREADS use a const HashTable&
1299 instead of a HashTable& in ThreadClassInfoHashTables to avoid
1300 initializing the latter with a const reference.
1302 * kjs/JSGlobalObject.cpp:
1304 2008-04-28 Alexey Proskuryakov <ap@webkit.org>
1308 * kjs/ExecState.h: For whatever reason, MSVC couldn't generate a default constructor for
1309 a struct that had a "const List" member. Removing the const qulifier makes the problem go away.
1311 2008-04-28 Alexey Proskuryakov <ap@webkit.org>
1315 Fix run-webkit-tests --threading
1316 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
1317 Proxy server issue in Sunday's Nightly
1319 Changed ClassInfo objects for built-in objects to hold a getter function returning
1320 a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
1321 and these are the only ones that need to be shared.
1324 (KJS::Lexer::Lexer):
1325 (KJS::Lexer::~Lexer):
1327 Made mainTable a member of Lexer, so that it no longer needs to be shared between threads.
1330 (KJS::JSObject::deleteProperty):
1331 (KJS::JSObject::findPropertyHashEntry):
1332 (KJS::JSObject::propertyIsEnumerable):
1333 (KJS::JSObject::getPropertyAttributes):
1334 (KJS::JSObject::getPropertyNames):
1336 (KJS::ClassInfo::propHashTable):
1337 Added a new classPropHashTableGetterFunction field to ClassInfo. If it is non-zero, the
1338 static table is not used.
1340 * kjs/JSGlobalObject.cpp:
1341 (KJS::ThreadClassInfoHashTables::ThreadClassInfoHashTables): This new class holds per-thread
1342 HashTables for built-in classes. The old static structs are copied to create per-thread
1344 (KJS::JSGlobalObject::threadClassInfoHashTables): An accessor/initializer for the above.
1345 (KJS::JSGlobalObject::init): Copy per-thread data into a single structure for faster access.
1346 Also, construct globalExec.
1347 (KJS::JSGlobalObject::reset): Adapted for globalExec now being an OwnPtr.
1348 (KJS::JSGlobalObject::mark): Ditto.
1349 (KJS::JSGlobalObject::globalExec): Ditto.
1350 * kjs/JSGlobalObject.h:
1351 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Made JSGlobalObject::JSGlobalObjectData::globalExec an OwnPtr, so that it can
1352 be initialized from JSGlobalObject::init() after them. Otherwise, ExecState constructor was
1353 trying to access half-initialized JSGlobalObject to make its own copy of these table
1354 references, and failed.
1355 (KJS::JSGlobalObject::JSGlobalObject): Pass "this" value to init() to create globalExec.
1356 (KJS::JSGlobalObject::perThreadData): An accessor for per-thread data.
1358 * kjs/ExecState.cpp:
1359 (KJS::ExecState::ExecState):
1361 (KJS::ExecState::propertyNames):
1362 (KJS::ExecState::emptyList):
1363 (KJS::ExecState::arrayTable):
1364 (KJS::ExecState::dateTable):
1365 (KJS::ExecState::mathTable):
1366 (KJS::ExecState::numberTable):
1367 (KJS::ExecState::RegExpImpTable):
1368 (KJS::ExecState::RegExpObjectImpTable):
1369 (KJS::ExecState::stringTable):
1370 * kjs/ExecStateInlines.h:
1371 (KJS::ExecState::ExecState):
1372 Each ExecState holds its own reference to per-thread data, for even faster access. Moved
1373 m_emptyList and m_propertyNames to the same structure, making ExecState faster to construct
1374 and take less space on the stack.
1376 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize thread-static data
1377 added to JSGlobalObject.
1379 * API/JSCallbackConstructor.cpp:
1381 * API/JSCallbackFunction.cpp:
1383 * API/JSCallbackObject.cpp:
1385 * JavaScriptCore.exp:
1386 * kjs/JSVariableObject.cpp:
1387 (KJS::JSVariableObject::getPropertyAttributes):
1388 * kjs/JSVariableObject.h:
1389 * kjs/array_instance.cpp:
1391 * kjs/array_object.cpp:
1393 (KJS::ArrayPrototype::getOwnPropertySlot):
1394 * kjs/bool_object.cpp:
1396 * kjs/create_hash_table:
1397 * kjs/date_object.cpp:
1399 (KJS::DatePrototype::getOwnPropertySlot):
1400 (KJS::DateObjectImp::DateObjectImp):
1401 * kjs/error_object.cpp:
1405 * kjs/function_object.cpp:
1406 (KJS::FunctionPrototype::FunctionPrototype):
1410 * kjs/math_object.cpp:
1412 (KJS::MathObjectImp::getOwnPropertySlot):
1413 * kjs/number_object.cpp:
1415 (KJS::NumberObjectImp::getOwnPropertySlot):
1416 * kjs/object_object.cpp:
1417 (KJS::ObjectPrototype::ObjectPrototype):
1418 * kjs/regexp_object.cpp:
1420 (KJS::RegExpPrototype::RegExpPrototype):
1421 (KJS::RegExpImp::getOwnPropertySlot):
1422 (KJS::RegExpImp::put):
1423 (KJS::RegExpObjectImp::getOwnPropertySlot):
1424 (KJS::RegExpObjectImp::put):
1425 * kjs/string_object.cpp:
1427 (KJS::StringPrototype::getOwnPropertySlot):
1428 Adjust for the above changes.
1430 2008-04-28 Darin Adler <darin@apple.com>
1434 - make sure RefPtr's default hash doesn't ref/deref when computing the hash
1435 - remove remnants of the hash table storage type optimization
1437 * wtf/HashFunctions.h: Used "using" to get the hash and equal functions
1438 from PtrHash<P*> into PtrHash<RefPtr<P>>.
1440 * wtf/HashMap.h: Replaced uses of PairBaseHashTraits with PairHashTraits.
1441 Eliminated storage-related typedefs. Removed constructor, destructor,
1442 copy constructor, and destructor since the compiler-generated ones are
1443 fine. Removed refAll and derefAll. Took out unnnecessary typecasts.
1444 Removed use of RefCounter.
1446 * wtf/HashSet.h: Eliminated storage-related typedefs. Removed constructor,
1447 destructor, copy constructor, and destructor since the compiler-generated
1448 ones are fine. Removed refAll and derefAll. Removed unneeded template
1449 arguents from HashSetTranslatorAdapter. Eliminated unneeded HashSetTranslator
1452 * wtf/HashTable.h: Tweaked formatting. Removed NeedsRef, RefCounterBase,
1453 RefCounter, HashTableRefCounterBase, HashTableRefCounter, and Assigner
1456 * wtf/HashTraits.h: Removed StorageTraits, needsRef, PairBaseHashTraits,
1457 and HashKeyStorageTraits.
1459 * wtf/RefPtrHashMap.h: Made all the same fixes as in HashMap. Also made
1460 the corresponding changes to RefPtrHashMapRawKeyTranslator.
1462 2008-04-28 Darin Adler <darin@apple.com>
1466 - fix assertion hit every time you view www.apple.com
1468 * kjs/PropertyNameArray.cpp:
1469 (KJS::PropertyNameArray::add): Changed assertion to allow null and empty strings.
1470 Now to find out why we have a property named "" and if that's a bug!
1472 2008-04-27 Mark Rowe <mrowe@apple.com>
1474 Reviewed by Maciej Stachowiak.
1476 Fix crash inside PtrHash::hash when loading a page.
1478 * wtf/HashFunctions.h: Explicitly use the superclass implementation of hash to avoid infinite recursion.
1480 2008-04-27 Darin Adler <darin@apple.com>
1484 - fix <rdar://problem/5657459> REGRESSION: JavaScriptCore no longer builds with
1485 GCC 4.2 due to pointer aliasing warnings
1487 Fix this by removing the HashTable optimizations that allowed us to share a back end
1488 implementation between hash tables with integers, pointers, RefPtr, and String objects
1489 as keys. The way it worked was incompatible with strict aliasing.
1491 This increases code size. On Mac OS X we'll have to regenerate .order files to avoid
1492 slowing down Safari startup times.
1494 This creates a slight slowdown in SunSpider, mitigated by the following four speedups:
1496 - speed up array put slightly by moving a branch (was already done for get)
1498 - speed up symbol table access by adding a function named inlineGet to HashMap
1499 and using that in symbolTableGet/Put
1501 - speed up PropertyNameArray creation by reducing the amount of reference count
1502 churn and uniqueness checking when adding names and not doing any allocation at
1503 all when building small arrays
1505 - speed up conversion of strings to floating point numbers by eliminating the
1506 malloc/free of the buffer for the ASCII copy of the string; a way to make
1507 things even faster would be to change strtod to take a UTF-16 string
1509 Note that there is considerable unused complexity now in HashSet/Map/Table to support
1510 "storage types", which is no longer used. Will do in a separate patch.
1512 * API/JSCallbackObjectFunctions.h:
1513 (KJS::JSCallbackObject<Base>::getPropertyNames): Removed explicit cast to Identifier to
1514 take advantage of the new PropertyNameArray::add overload and avoid reference count churn.
1515 * API/JSObjectRef.cpp:
1516 (JSPropertyNameAccumulatorAddName): Ditto.
1517 * JavaScriptCore.exp: Updated PropertyNameArray::add entry point name.
1519 * kjs/JSVariableObject.cpp: Removed now-unneeded IdentifierRepHashTraits::nullRepPtr
1520 definition (see below).
1521 (KJS::JSVariableObject::getPropertyNames): Removed explicit cast to Identifier.
1523 * kjs/JSVariableObject.h:
1524 (KJS::JSVariableObject::symbolTableGet): Use inlineGet for speed. Also changed to do
1525 early exit instead of nesting the body inside an if.
1526 (KJS::JSVariableObject::symbolTablePut): Ditto.
1528 * kjs/PropertyNameArray.cpp:
1529 (KJS::PropertyNameArray::add): Changed implementation to take a raw pointer instead of
1530 a reference to an identifier. Do uniqueness checking by searching the vector when the
1531 vector is short, only building the set once the vector is large enough.
1533 * kjs/PropertyNameArray.h: Added an overload of add for a raw pointer, and made the old
1534 add function call that one. Added an addKnownUnique function for use when the new
1535 name is known to be different from any other in the array. Changed the vector to have
1536 an inline capacity of 20.
1538 * kjs/SymbolTable.h: Changed IdentifierRepHash to inherit from the default hash for
1539 a RefPtr so we don't have to define so much. Added an overload of the hash function for
1540 a raw pointer as required by the new RefPtrHashMap. Got rid of the now-unneeded
1541 IdentifierRepHashTraits -- the default traits now work fine. Added a definition of
1542 empthValueIsZero to SymbolTableIndexHashTraits; not having it was incorrect, but harmless.
1544 * kjs/array_instance.cpp:
1545 (KJS::ArrayInstance::put): Move the maxArrayIndex check inside the branch that checks
1546 the index against the length, as done in the get function.
1549 (KJS::globalFuncKJSPrint): Changed to use the new getCString instead of cstring.
1551 * kjs/internal.cpp: Removed printInfo debugging function, a client of cstring.
1552 If we need a debugging function we can easily make a better one and we haven't
1553 used this one in a long time.
1554 * kjs/internal.h: Ditto.
1557 (KJS::JSObject::getPropertyNames): Removed explicit cast to Identifier.
1558 * kjs/property_map.cpp:
1559 (KJS::PropertyMap::getEnumerablePropertyNames): Ditto. Also added a special case for
1560 the case where the propertyNames array is empty -- in that case we know we're adding
1561 a set of names that are non-overlapping so we can use addKnownUnique.
1563 (KJS::UString::getCString): Replaces cstring. Puts the C string into a CStringBuffer,
1564 which is a char Vector with an inline capacity. Also returns a boolean to indicate if
1565 the converion was lossy, which eliminates the need for a separate is8Bit call.
1566 (KJS::UString::toDouble): Changed to call getCString instead of cstring.
1567 * kjs/ustring.h: Ditto.
1569 * wtf/HashFunctions.h: Overload the hash and equal functions for RefPtr's default
1570 hash to take raw pointers. This works with the changes to RefPtrHashMap to avoid
1571 introducing refcount churn.
1573 * wtf/HashMap.h: Removed special code to convert the deleted value to the empty value
1574 when writing a new value into the map. This is now handled elsewhere.
1575 (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1576 HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1579 (WTF::HashTable::isDeletedBucket): Changed to use isDeletedValue instead of using
1580 deletedValue and the equality operator.
1581 (WTF::HashTable::deleteBucket): Changed to use constructDeletedValue instead of
1582 using deletedValue and the assignment operator.
1583 (WTF::HashTable::checkKey): Added. Factors out the check for values that are empty
1584 or deleted keys that's used in various functions below.
1585 (WTF::HashTable::lookup): Changed to use checkKey, check for a 0 table, and also
1586 made public for use by RefPtrHashMap.
1587 (WTF::HashTable::lookupForWriting): Changed to use checkKey.
1588 (WTF::HashTable::fullLookupForWriting): Changed to use checkKey.
1589 (WTF::HashTable::add): Changed to use checkKey, and call initializeBucket on a
1590 deleted bucket before putting a new entry into it.
1591 (WTF::HashTable::addPassingHashCode): Ditto.
1592 (WTF::HashTable::deallocateTable): Check isDeletedBucket before calling ~ValueType.
1594 * wtf/HashTraits.h: Got ridd of all the HashTraits specialization for the integer
1595 types, since GeneicHashTraitsBase already deals with integers separately. Put the
1596 deleted value support into GenericHashTraitsBase. Changed FloatHashTraits to
1597 inherit from GenericHashTraits, and define construct/isDeletedValue rather than
1598 deletedValue. Removed the ref and deref functions from RefPtr's HashTraits, and
1599 defined construct/isDeletedValue. Eliminated DeletedValueAssigner. Changed
1600 PairHashTraits to define construct/isDeletedValue, and also merged
1601 PairBaseHashTraits in with PairHashTraits. Got rid of all specialization of
1602 HashKeyStorageTraits. We'll remove that, and the needsRef data member, later.
1604 * wtf/RefPtr.h: Added HashTableDeletedValueType, an enum type with a single value,
1605 HashTableDeletedValue. Used that type to make a new constructor to construct
1606 deleted values and also added an isHashTableDeletedValue function.
1608 * wtf/RefPtrHashMap.h: Added RefPtrHashMapRawKeyTranslator and used it to implement
1609 the raw pointer functions. This is a way to continue to avoid refcount thrash. We
1610 can't use the old way because it depended on the underlying map using a non-RefPtr
1612 (WTF::HashMap::find): Use find with RefPtrHashMapRawKeyTranslator.
1613 (WTF::HashMap::contains): Use contains with RefPtrHashMapRawKeyTranslator.
1614 (WTF::HashMap::inlineAdd): Use add with RefPtrHashMapRawKeyTranslator.
1615 (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1616 HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1617 (WTF::HashMap::inlineGet): Added. Just like get, but marked inline for use in the
1620 2008-04-25 Sam Weinig <sam@webkit.org>
1622 Rubber-stamped by Mark Rowe.
1624 Remove SavedBuiltins and SavedProperties classes and the methods used to
1625 save data to them. The CachedPage now stores a the JSGlobalObject in full.
1627 * JavaScriptCore.exp:
1628 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1629 * JavaScriptCore.xcodeproj/project.pbxproj:
1630 * kjs/JSGlobalObject.cpp:
1631 * kjs/JSGlobalObject.h:
1632 * kjs/JSVariableObject.cpp:
1633 * kjs/JSVariableObject.h:
1634 (KJS::JSVariableObject::localStorage):
1635 * kjs/SavedBuiltins.h: Removed.
1637 * kjs/property_map.cpp:
1638 * kjs/property_map.h:
1640 2008-04-25 Mark Rowe <mrowe@apple.com>
1642 Rubber-stamped by Sam Weinig.
1644 Add some content to an empty ICU header file to prevent verification errors.
1646 * icu/unicode/utf_old.h:
1648 2008-04-25 David Kilzer <ddkilzer@apple.com>
1650 <rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
1652 Patch by George Dicker and Michael Kahl. Reviewed by Darin.
1654 When -[NSObject(WebScriptDebugDelegate) webView:willLeaveCallFrame:sourceId:line:forWebFrame:]
1655 is invoked, the first line number of the function is returned instead of the last
1656 line number. This regressed in r28458.
1659 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
1660 when calling Debugger::returnEvent().
1662 2008-04-25 Darin Adler <darin@apple.com>
1664 Done with Stephanie Lewis.
1666 * JavaScriptCore.xcodeproj/project.pbxproj: Prepare for compilation with gcc 4.2 by
1667 adding -fno-strict-aliasing to CollatorICU.cpp.
1669 2008-04-24 Sam Weinig <sam@webkit.org>
1671 Reviewed by Geoffrey Garen.
1673 Add a #define to easily enable collecting on every allocation to aid
1676 * kjs/collector.cpp:
1677 (KJS::Collector::heapAllocate):
1679 2008-04-24 Kevin McCullough <kmccullough@apple.com>
1681 Reviewed by Adam and Sam.
1683 -<rdar://problem/5770054> JavaScript profiler (10928)
1684 -Only profile the page group that starts profiling to avoid profiling
1685 tools that shouldn't be profiled unless explicitly requested to.
1687 * JavaScriptCore.exp: Export new signature.
1688 * kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject.
1689 (KJS::JSGlobalObject::init):
1690 * kjs/JSGlobalObject.h: Ditto.
1691 (KJS::JSGlobalObject::setPageGroupIdentifier):
1692 (KJS::JSGlobalObject::pageGroupIdentifier):
1693 * profiler/Profiler.cpp: Check the identifier of the page group of the
1694 lexical global exec state and only profile if it matches the given page
1696 (KJS::Profiler::startProfiling):
1697 (KJS::Profiler::willExecute):
1698 (KJS::Profiler::didExecute):
1699 * profiler/Profiler.h: Ditto.
1700 (KJS::Profiler::Profiler):
1702 2008-04-24 Julien Chaffraix <jchaffraix@webkit.org>
1706 Bug 15940: Implement threading API for Qt
1707 https://bugs.webkit.org/show_bug.cgi?id=15940
1709 Original patch by Justin Haygood, tweaked by me.
1711 * JavaScriptCore.pri:
1712 * wtf/ThreadingQt.cpp: Added.
1713 (WTF::threadMapMutex):
1715 (WTF::establishIdentifierForThread):
1716 (WTF::clearThreadForIdentifier):
1717 (WTF::threadForIdentifier):
1718 (WTF::initializeThreading):
1719 (WTF::ThreadPrivate::getReturnValue):
1720 (WTF::ThreadPrivate::ThreadPrivate):
1721 (WTF::ThreadPrivate::run):
1722 (WTF::createThread):
1723 (WTF::waitForThreadCompletion): return !res to return
1724 0 on success (to match the pthreads implementation).
1725 (WTF::detachThread):
1726 (WTF::identifierByQthreadHandle):
1727 (WTF::currentThread):
1728 (WTF::Mutex::Mutex):
1729 (WTF::Mutex::~Mutex):
1731 (WTF::Mutex::tryLock):
1732 (WTF::Mutex::unlock):
1733 (WTF::ThreadCondition::ThreadCondition):
1734 (WTF::ThreadCondition::~ThreadCondition):
1735 (WTF::ThreadCondition::wait):
1736 (WTF::ThreadCondition::timedWait):
1737 (WTF::ThreadCondition::signal):
1739 2008-04-22 Darin Adler <darin@apple.com>
1743 - simplify use of HashTraits to prepare for some upcoming hash table changes
1745 * kjs/SymbolTable.h: Made SymbolTableIndexHashTraits derive from HashTraits<size_t>
1746 and specialize only the empty value.
1748 2008-04-23 Holger Hans Peter Freyther <zecke@selfish.org>
1752 Removed the #define for USE_SYSTEM_MALLOC that we set in WebKit.pri
1757 2008-04-21 Kevin McCullough <kmccullough@apple.com>
1761 <rdar://problem/5770054> JavaScript profiler (10928)
1762 - When stop profiling is called we need to stop the timers on all the
1763 functions that are still running.
1765 * profiler/FunctionCallProfile.cpp:
1766 (KJS::FunctionCallProfile::didExecute):
1767 (KJS::FunctionCallProfile::stopProfiling):
1768 * profiler/FunctionCallProfile.h:
1769 * profiler/Profiler.cpp:
1770 (KJS::Profiler::stopProfiling):
1772 2008-04-21 Alexey Proskuryakov <ap@webkit.org>
1776 Move collector main thread initialization from WebKit/win to KJS::initializeThreading.
1778 * kjs/InitializeThreading.cpp:
1779 (KJS::initializeThreading):
1781 2008-04-21 Adam Roben <aroben@apple.com>
1785 Reviewed by Alexey Proskuryakov.
1788 (KJS::UString::cost): Disable a warning about assigning a 32-bit
1789 size_t into a 31-bit size_t.
1791 2008-04-21 Simon Hausmann <hausmann@webkit.org>
1795 Made convertValueToQVariant accessible from within WebKit/qt/Api
1797 * bindings/qt/qt_runtime.h:
1799 2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
1803 Build fix for Qt 4.3
1805 * When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is
1806 always defined. Do this by adding defines to the compiler line
1807 * For users of our API this is not feasible. Every public header file should
1808 include qwebkitglobal.h. Define the QT_BEGIN_NAMESPACE and QT_END_NAMESPACE
1809 when we are building everything < 4.4.0 and don't have them defined.
1813 2008-04-19 Matt Lilek <webkit@mattlilek.com>
1815 Not reviewed, Windows build fix - copy the profiler headers in all
1816 configurations, not just Debug_Internal.
1818 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1820 2008-04-19 Mike Hommey <glandium@debian.org>
1822 Reviewed by Alp Toker.
1824 Don't build testkjs with rpath.
1828 2008-04-18 Kevin Ollivier <kevino@theolliviers.com>
1830 wx build fixes. Rename LocalStorage.h to LocalStorageEntry.h
1831 to avoid header detection issues between WebCore/storage/LocalStorage.h
1832 and it, and add $(PROFILER_SOURCES) to the wx JSCore build.
1834 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1835 * JavaScriptCore.xcodeproj/project.pbxproj:
1838 * kjs/JSVariableObject.h:
1839 * kjs/LocalStorage.h: Removed.
1840 * kjs/LocalStorageEntry.h: Copied from JavaScriptCore/kjs/LocalStorage.h.
1843 2008-04-18 Jan Michael Alonzo <jmalonzo@unpluggable.com>
1845 Reviewed by Alp Toker.
1847 http://bugs.webkit.org/show_bug.cgi?id=16620
1848 [GTK] Autotools make dist and make check support
1854 2008-04-18 Jon Honeycutt <jhoneycutt@apple.com>
1856 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Windows
1859 2008-04-11 Mark Rowe <mrowe@apple.com>
1861 Rubber-stamped by Antti Koivisto.
1863 Silence GCC 4.3 warnings by removing extraneous consts.
1868 2008-04-18 Kevin McCullough <kmccullough@apple.com>
1872 -<rdar://problem/5770054> JavaScript profiler (10928)
1873 - Use Deque instead of Vector since the profiler uses prepend a lot
1874 and deque is faster at that.
1876 * profiler/FunctionCallProfile.h:
1877 (KJS::FunctionCallProfile::milliSecs): Corrected the name to match
1880 (WTF::deleteAllValues):
1882 2008-04-18 Kevin McCullough <kmccullough@apple.com>
1884 Reviewed by Sam and Adam.
1886 -<rdar://problem/5770054> JavaScript profiler (10928)
1887 - Cleaned up the header file and made some functions static, added
1888 a new, sane, printing function, and fixed a few minor bugs.
1890 * JavaScriptCore.exp:
1891 * JavaScriptCore.xcodeproj/project.pbxproj:
1892 * profiler/FunctionCallProfile.cpp:
1893 (KJS::FunctionCallProfile::didExecute): Removed assertion that time is
1894 > 0 because at ms resolution that may not be true and only cross-
1895 platform way to get time differences is in ms.
1896 (KJS::FunctionCallProfile::printDataInspectorStyle): Added a new
1897 printing function for dumping data in a sane style.
1898 (KJS::FunctionCallProfile::printDataSampleStyle): Fixed a bug where we
1899 displayed too much precision when printing our floats. Also added logic
1900 to make sure we don't display 0 because that doesn't make sense for a
1902 * profiler/FunctionCallProfile.h:
1903 * profiler/Profiler.cpp: Moved functions that could be static into the
1904 implementation, and chaned the ASSERTs to early returns. I did this
1905 because console.profile() is a JS function and so was being profiled
1906 but asserting because the profiler had not been started! In the future
1907 I would like to put the ASSERTs back and not profile the calls to
1908 console.profile() and console.profileEnd().
1909 (KJS::Profiler::willExecute):
1910 (KJS::Profiler::didExecute):
1911 (KJS::getStackNames): Fixed a bug where the wrong ExecState was being
1913 (KJS::getFunctionName):
1914 (KJS::Profiler::printDataInspectorStyle):
1915 * profiler/Profiler.h:
1917 2008-04-18 Alexey Proskuryakov <ap@webkit.org>
1921 Fix leaks during plugin tests (which actually excercise background JS), and potential
1922 PAC brokenness that was not reported, but very likely.
1924 The leaks shadowed a bigger problem with Identifier destruction. Identifier::remove involves
1925 an IdentifierTable lookup, which is now a per-thread instance. Since garbage collection can
1926 currently happen on a different thread than allocation, a wrong table was used.
1928 No measurable change on SunSpider total, ~1% variation on individual tests.
1932 (KJS::UString::Rep::create):
1933 (KJS::UString::Rep::destroy):
1935 Replaced isIdentifier with a pointer to IdentifierTable, so that destruction can be done
1936 correctly. Took one bit from reportedCost, to avoid making UString::Rep larger (performance
1937 effect was measurable on SunSpider).
1939 * kjs/identifier.cpp:
1940 (KJS::IdentifierTable::IdentifierTable):
1941 (KJS::IdentifierTable::~IdentifierTable):
1942 (KJS::IdentifierTable::add):
1943 (KJS::IdentifierTable::remove):
1944 Make IdentifierTable a real class. Its destructor needs to zero out outstanding references,
1945 because some identifiers may briefly outlive it during thread destruction, and we don't want
1946 them to use their stale pointers.
1948 (KJS::LiteralIdentifierTable):
1949 (KJS::Identifier::add):
1950 Now that LiteralIdentifierTable is per-thread and can be destroyed not just during application
1951 shutdown, it is not appropriate to simply bump refcount for strings that get there; changed
1952 the table to hold RefPtrs.
1954 (KJS::CStringTranslator::translate):
1955 (KJS::UCharBufferTranslator::translate):
1956 (KJS::Identifier::addSlowCase):
1957 (KJS::Identifier::remove):
1959 (KJS::Identifier::add):
1960 Use and update UString::Rep::identifierTable as appropriate. Updating it is now done in
1961 IdentifierTable::add, not in translators.
1963 2008-04-18 Alexey Proskuryakov <ap@webkit.org>
1967 Get rid of static compareWithCompareFunctionArguments in array_instance.cpp.
1969 No change on SunSpider, CelticKane or iBench JavaScript. It is probable that in some cases,
1970 merge sort is still faster, but more investigation is needed to determine a new cutoff.
1971 Or possibly, it would be better to do what FIXME says (change to tree sort).
1973 Also, made arguments a local variable - not sure why it was a member of
1974 CompareWithCompareFunctionArguments.
1976 * kjs/array_instance.cpp:
1977 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1978 (KJS::CompareWithCompareFunctionArguments::operator()):
1979 (KJS::ArrayInstance::sort):
1981 2008-04-18 Simon Hausmann <hausmann@webkit.org>
1983 Build fix for gcc 4.3. Include stdio.h for printf.
1985 * profiler/FunctionCallProfile.cpp:
1986 * profiler/Profiler.cpp:
1988 2008-04-17 Jon Honeycutt <jhoneycutt@apple.com>
1992 * wtf/Platform.h: Add HAVE_ACCESSIBILITY to Platform.h.
1994 2008-04-17 Alexey Proskuryakov <ap@webkit.org>
1998 Thread static data destructors are not guaranteed to be called in any particular order;
1999 turn ThreadSpecific into a phoenix-style singleton to avoid accessing freed memory when
2000 deleted objects are interdependent (e.g. CommonIdentifiers and internal identifier tables).
2002 No change on SunSpider.
2004 * wtf/ThreadSpecific.h:
2005 (WTF::ThreadSpecific::Data::Data):
2010 2008-04-15 Srinivas Rao. M Hamse <msrinirao@gmail.com>
2012 Reviewed by Maciej Stachowiak.
2016 * kjs/nodes.h: CallerType definition made public for gcc 3.x compilation
2018 2008-04-16 Brady Eidson <beidson@apple.com>
2020 Reviewed by Sam Weinig
2022 Change ThreadSafeShared to act like RefCounted by starting out with a single ref by default
2025 (WTF::ThreadSafeShared::ThreadSafeShared):
2027 2008-04-16 Sam Weinig <sam@webkit.org>
2029 Reviewed by Geoffrey Garen.
2031 - To keep the behavior of the WebKit and JavaScriptCore API's the same,
2032 we need to hide the fact that the global object and the window object
2033 are no longer the same thing, and the the global object now changes on
2034 navigations. To do this, only the wrapper should ever be exposed. This
2035 fixes the two remaining spots where the internal global object is exposed,
2036 the windowScriptObject returned from [WebFrame windowObject] and the object
2037 return by calling JSContextGetGlobalObject on [WebFrame globalContext].
2039 * API/JSContextRef.cpp:
2040 (JSContextGetGlobalObject):
2041 This is a bit of a hack, this returns the "this" representation of the globalObject
2042 which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
2044 * API/JSObjectRef.cpp:
2045 (JSObjectSetProperty):
2046 Call the new putWithAttributes method instead of relying on lower-level calls.
2047 This is needed so that the window wrapper can forward the calls.
2049 * JavaScriptCore.exp:
2051 * kjs/JSGlobalObject.cpp:
2052 (KJS::JSGlobalObject::putWithAttributes):
2053 * kjs/JSGlobalObject.h:
2054 * kjs/JSVariableObject.h:
2055 (KJS::JSVariableObject::symbolTablePutWithAttributes):
2057 (KJS::ActivationImp::putWithAttributes):
2059 (KJS::ConstDeclNode::handleSlowCase):
2060 (KJS::ConstDeclNode::evaluateSingle):
2061 (KJS::EvalNode::processDeclarations):
2063 (KJS::JSObject::putWithAttributes):
2065 Rename initializeVariable to putWithAttributes and move it down to JSObject so it
2066 can be used for JSObjectSetProperty.
2068 2008-04-16 Kevin McCullough <kmccullough@apple.com>
2070 Reviewed by Sam and Geoff.
2072 -<rdar://problem/5770054> JavaScript profiler (10928)
2073 Inital profiler prototype
2075 * GNUmakefile.am: Added new files to project
2076 * JavaScriptCore.pri: Ditto
2077 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
2078 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto
2079 * JavaScriptCoreSources.bkl: Ditto
2080 * kjs/config.h: Put compiling flag in here.
2081 * kjs/function.cpp: Instrument calling the function eval().
2083 * kjs/interpreter.cpp: Instrument evaluating global scopes.
2084 (KJS::Interpreter::evaluate):
2085 * kjs/object.cpp: Instrument JS function calls.
2086 (KJS::JSObject::call):
2088 * profiler/FunctionCallProfile.cpp: Added.
2089 (KJS::FunctionCallProfile::FunctionCallProfile):
2090 (KJS::FunctionCallProfile::~FunctionCallProfile):
2091 (KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer.
2092 (KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer.
2093 (KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile.
2094 (KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one.
2095 (KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
2096 * profiler/FunctionCallProfile.h: Added.
2097 (KJS::FunctionCallProfile::FunctionCallProfile):
2098 (KJS::FunctionCallProfile::~FunctionCallProfile):
2099 (KJS::FunctionCallProfile::functionName):
2100 (KJS::FunctionCallProfile::microSecs):
2101 * profiler/Profiler.cpp: Added.
2102 (KJS::Profiler::profiler):
2103 (KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns)
2104 (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.
2105 (KJS::Profiler::stopProfiling): Stop collecting profile information.
2106 (KJS::Profiler::willExecute): Same as above.
2107 (KJS::Profiler::didExecute): Same as above.
2108 (KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it.
2109 (KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack.
2110 (KJS::Profiler::getFunctionName): Get the function name from the given parameter.
2111 (KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
2112 (KJS::Profiler::debugLog):
2113 * profiler/Profiler.h: Added.
2114 (KJS::Profiler::Profiler):
2116 2008-04-16 Sam Weinig <sam@webkit.org>
2118 Reviewed by Darin Adler.
2120 - Remove kjs_ prefix from strtod, dtoa, and freedtoa and put it
2121 in the KJS namespace.
2122 - Make strtod, dtoa, and freedtoa c++ functions instead of extern "C".
2123 - Remove mode switching from dtoa. ~2% improvement on test 26.
2124 - Removes all unnecessary #defines from dtoa code.
2126 * JavaScriptCore.exp:
2141 * kjs/number_object.cpp:
2142 (KJS::integer_part_noexp):
2143 (KJS::numberProtoFuncToExponential):
2145 (KJS::UString::from):
2146 (KJS::UString::toDouble):
2148 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2152 Get rid of static execForCompareByStringForQSort in array_instance.cpp.
2154 No change on SunSpider, CelticKane or iBench JavaScript.
2156 * kjs/array_instance.cpp:
2157 (KJS::ArraySortComparator::ArraySortComparator):
2158 (KJS::ArraySortComparator::operator()):
2159 (KJS::ArrayInstance::sort):
2160 Switch slow case to std::sort, so that ExecState can be passed in a comparator.
2162 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2164 Reviewed by Adam Roben.
2168 * kjs/CommonIdentifiers.cpp:
2169 * kjs/CommonIdentifiers.h:
2172 * kjs/identifier.cpp:
2174 * wtf/ThreadSpecific.h:
2176 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2180 * kjs/date_object.cpp:
2181 * kjs/date_object.h:
2182 Don't include DateMath.h from date_object.h, as the latter is used from WebCore, while
2183 where the former is not available.
2185 2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
2187 Unreviewed build fix for MSVC. It does not want to have
2188 WTF in the KJS namespace.
2190 * kjs/CommonIdentifiers.h:
2192 2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
2194 Unreviewed build fix for gcc.
2196 ::msToGregorianDateTime is not known to it.
2198 * kjs/date_object.cpp:
2199 (KJS::DateInstance::msToGregorianDateTime):
2201 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2203 Reviewed by Oliver Hunt.
2205 Initialize threadMapMutex safely (as already done in ThreadingWin).
2207 * wtf/ThreadingGtk.cpp:
2208 (WTF::threadMapMutex):
2209 (WTF::initializeThreading):
2210 * wtf/ThreadingPthreads.cpp:
2211 (WTF::threadMapMutex):
2212 (WTF::initializeThreading):
2214 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2216 Reviewed by Adam Roben.
2218 Cache Gregorian date/time structure on DateInstance objects for 1.027x SunSpider speedup
2219 (1.65x on date-format-xparb, 1.13x on date-format-tofte).
2222 (KJS::GregorianDateTime::copyFrom): Added. It presumably makes sense to keep GregorianDateTime
2223 Noncopyable, so it's not just operator=.
2225 * kjs/date_object.h: Added a per-object cache.
2227 * kjs/date_object.cpp:
2228 (KJS::DateInstance::DateInstance):
2229 (KJS::DateInstance::msToGregorianDateTime):
2230 (KJS::dateProtoFuncToString):
2231 (KJS::dateProtoFuncToUTCString):
2232 (KJS::dateProtoFuncToDateString):
2233 (KJS::dateProtoFuncToTimeString):
2234 (KJS::dateProtoFuncToLocaleString):
2235 (KJS::dateProtoFuncToLocaleDateString):
2236 (KJS::dateProtoFuncToLocaleTimeString):
2237 (KJS::dateProtoFuncGetFullYear):
2238 (KJS::dateProtoFuncGetUTCFullYear):
2239 (KJS::dateProtoFuncToGMTString):
2240 (KJS::dateProtoFuncGetMonth):
2241 (KJS::dateProtoFuncGetUTCMonth):
2242 (KJS::dateProtoFuncGetDate):
2243 (KJS::dateProtoFuncGetUTCDate):
2244 (KJS::dateProtoFuncGetDay):
2245 (KJS::dateProtoFuncGetUTCDay):
2246 (KJS::dateProtoFuncGetHours):
2247 (KJS::dateProtoFuncGetUTCHours):
2248 (KJS::dateProtoFuncGetMinutes):
2249 (KJS::dateProtoFuncGetUTCMinutes):
2250 (KJS::dateProtoFuncGetSeconds):
2251 (KJS::dateProtoFuncGetUTCSeconds):
2252 (KJS::dateProtoFuncGetTimezoneOffset):
2253 (KJS::setNewValueFromTimeArgs):
2254 (KJS::setNewValueFromDateArgs):
2255 (KJS::dateProtoFuncSetYear):
2256 (KJS::dateProtoFuncGetYear):
2257 Use the cache when converting.
2259 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2263 Implement an abstraction for thread-specific storage, use it to get rid of some static objects.
2265 SunSpider results were not conclusive, possibly up to 0.2% slowdown.
2267 * JavaScriptCore.xcodeproj/project.pbxproj:
2268 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2269 Added ThreadSpecific.h
2271 * wtf/ThreadSpecific.h: Added.
2272 (WTF::::ThreadSpecific):
2273 (WTF::::~ThreadSpecific):
2279 Only implemented for platforms that use pthreads.
2281 * kjs/CommonIdentifiers.cpp:
2282 (KJS::CommonIdentifiers::shared):
2283 * kjs/CommonIdentifiers.h:
2284 * kjs/InitializeThreading.cpp:
2285 (KJS::initializeThreading):
2289 * kjs/identifier.cpp:
2290 (KJS::identifierTable):
2291 (KJS::literalIdentifierTable):
2292 (KJS::Identifier::initializeIdentifierThreading):
2297 Make static instances per-thread.
2299 2008-04-15 Anders Carlsson <andersca@apple.com>
2303 Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
2305 * Configurations/JavaScriptCore.xcconfig:
2307 2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
2311 Fix compilation with Qt namespaces
2313 Qt can be configured to have all of its classes inside a specified namespaces.
2314 This is for example used in plugin/component environments like Eclipse.
2316 This change makes it possible to let the Qt port compile against a namespaced
2317 Qt by the use of macros Qt provides to properly forward declare Qt classes in
2320 * wtf/unicode/qt4/UnicodeQt4.h:
2322 2008-04-14 Anders Carlsson <andersca@apple.com>
2326 Don't leak the prototype class.
2328 * API/JSClassRef.cpp:
2329 (OpaqueJSClass::create):
2331 2008-04-14 Steve Falkenburg <sfalken@apple.com>
2335 * wtf/ThreadingWin.cpp:
2337 2008-04-14 Alexey Proskuryakov <ap@webkit.org>
2339 Reviewed by Adam Roben.
2341 https://bugs.webkit.org/show_bug.cgi?id=18488
2342 FastMalloc doesn't release thread-specific data on Windows
2344 * wtf/ThreadingWin.cpp:
2345 (WTF::threadMapMutex): (WTF::initializeThreading): Call threadMapMutex once to initialize the static safely.
2346 (WTF::ThreadFunctionInvocation::ThreadFunctionInvocation): Added a structure to wrap thread entry point and arguments.
2347 (WTF::wtfThreadEntryPoint): Make sure to end all WTF threads with pthread_exit(), to give pthreads-win32 a chance to call
2348 destructors of thread-specific data.
2349 (WTF::createThread): Use _beginthreadex instead of CreateThread, because MSDN says so. Also removed a call to CreateEvent,
2350 for which I could see no reason at all.
2352 2008-04-14 Alexey Proskuryakov <ap@webkit.org>
2354 Touched a file to make JavaScriptCore.vcproj rebuild.
2358 2008-04-14 Adam Roben <aroben@apple.com>
2362 Rubberstamped by Alexey Proskuryakov.
2364 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
2365 the "potentially uninitialized variable" warning for grammar.cpp, as
2366 it seems to be incorrect. yylval gets initialized by the lexer, but
2367 MSVC doesn't seem to understand this.
2369 2008-04-11 Antti Koivisto <antti@apple.com>
2373 Add default hash for pairs of hashable types.
2375 * wtf/HashFunctions.h:
2376 (WTF::PairHash::hash):
2377 (WTF::PairHash::equal):
2380 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2384 Make DateMath.cpp thread safe.
2386 No measurable change on SunSpider (should be a very small speedup).
2389 (KJS::mimimumYearForDST): (KJS::equivalentYearForDST): Got rid of double caching of the
2390 same precomputed value.
2391 (KJS::calculateUTCOffset): (KJS::getUTCOffset): Factored actual UTC offset calculation code
2392 out of getUTCOffset(), and notification setup into initDateMath().
2394 (KJS::initDateMath): Added.
2397 * kjs/InitializeThreading.cpp:
2398 (KJS::initializeThreading):
2399 Added initDateMath().
2401 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2407 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2409 Tiger build fix. Forward declaring a union didn't work for whatever reason, make the
2418 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2422 Generate a pure (re-entrant) parser with Bison.
2424 No change on SunSpider.
2427 (KJS::Parser::parse):
2433 Pass state as function arguments, instead of global data. Don't call lexer() as often as
2434 before, as this function is about to become slower due to thread-specific storage.
2437 (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are
2438 already taken care of. This is a small speedup, compensating for a small slowdown caused
2439 by switching Bison mode.
2441 2008-04-10 Alexey Proskuryakov <ap@webkit.org>
2445 https://bugs.webkit.org/show_bug.cgi?id=18402
2446 REGRESSION: visited element handling is incorrect in nested join/toString calls
2448 No change on SunSpider total, possibly a tiny improvement (about 0.1%).
2450 Test: fast/js/array-tostring-and-join.html
2452 * kjs/JSGlobalObject.h:
2453 (KJS::JSGlobalObject::visitedElements): Store visited elements HashSet here, making it
2454 common to toString/toLocalizedString/join again.
2456 * kjs/array_object.cpp:
2457 (KJS::arrayProtoFuncToString):
2458 (KJS::arrayProtoFuncToLocaleString):
2459 (KJS::arrayProtoFuncJoin):
2460 Got rid of static variables. Replaced UString with Vector to avoid O(n^2) behavior and
2466 (WTF::::reserveCapacity):
2469 Added null checks, so that Vector methods don't crash when out of memory. The caller should
2470 check that data pointer is not null before proceeding.
2472 2008-04-10 Mark Rowe <mrowe@apple.com>
2474 Reviewed by Maciej Stachowiak.
2476 Fix https://bugs.webkit.org/show_bug.cgi?id=18367 and the many dupes.
2477 Bug 18367: Crash during celtic kane js speed 2007 test
2479 GCC 4.2 on x86_64 Linux decided to reorder the local variables in markCurrentThreadConservatively's
2480 stack frame. This lead to the range of addresses the collector treated as stack to exclude the
2481 contents of volatile registers that markCurrentThreadConservatively forces onto the stack. This was
2482 leading to objects being prematurely collected if the only reference to them was via a register at
2483 the time a collection occurred.
2485 The fix for this is to move the calculation of the top of the stack into a NEVER_INLINE function
2486 that is called from markCurrentThreadConservatively. This forces the dummy variable we use for
2487 determining the top of stack to be in a different stack frame which prevents the compiler from
2488 reordering it relative to the registers that markCurrentThreadConservatively forces onto the stack.
2490 * kjs/collector.cpp:
2491 (KJS::Collector::markCurrentThreadConservativelyInternal):
2492 (KJS::Collector::markCurrentThreadConservatively):
2495 2008-04-10 Adam Roben <aroben@apple.com>
2497 VC++ Express build fix
2499 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Link against user32.lib so
2500 that anyone who links against WTF.lib will get user32.lib
2503 2008-04-09 Adam Roben <aroben@apple.com>
2505 VC++ Express build fix
2507 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
2510 2008-04-09 Adam Roben <aroben@apple.com>
2514 * JavaScriptCore.exp: Export isMainThread.
2516 2008-04-09 Adam Roben <aroben@apple.com>
2520 * wtf/AlwaysInline.h: Make sure to #include Platform.h before using
2521 the macros it defines.
2523 2008-04-08 Mark Rowe <mrowe@apple.com>
2525 Export WTF::initializeThreading() from JavaScriptCore.
2527 * JavaScriptCore.exp:
2529 2008-04-04 Sam Weinig <sam@webkit.org>
2531 Reviewed by Geoffrey Garen.
2533 First step in implementing the "split window"
2535 - Add a GlobalThisValue to ExecState which should be used
2536 in places that used to implement the "use the global object
2537 as this if null" rule.
2538 - Factor out lookupGetter/lookupSetter into virtual methods
2539 on JSObject so that they can be forwarded.
2540 - Make defineGetter/defineSetter virtual methods for the same
2542 - Have PrototypeReflexiveFunction store the globalObject used
2543 to create it so that it can be used to get the correct thisObject
2546 * API/JSObjectRef.cpp:
2547 (JSObjectCallAsFunction):
2548 * JavaScriptCore.exp:
2550 * kjs/ExecState.cpp:
2551 (KJS::ExecState::ExecState):
2552 (KJS::GlobalExecState::GlobalExecState):
2554 (KJS::ExecState::globalThisValue):
2555 * kjs/ExecStateInlines.h:
2556 (KJS::ExecState::ExecState):
2557 (KJS::FunctionExecState::FunctionExecState):
2558 * kjs/JSGlobalObject.cpp:
2559 (KJS::JSGlobalObject::reset):
2560 (KJS::JSGlobalObject::toGlobalObject):
2561 * kjs/JSGlobalObject.h:
2562 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
2563 (KJS::JSGlobalObject::JSGlobalObject):
2564 * kjs/array_instance.cpp:
2565 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2566 (KJS::compareWithCompareFunctionForQSort):
2567 * kjs/array_object.cpp:
2568 (KJS::arrayProtoFuncSort):
2569 (KJS::arrayProtoFuncFilter):
2570 (KJS::arrayProtoFuncMap):
2571 (KJS::arrayProtoFuncEvery):
2572 (KJS::arrayProtoFuncForEach):
2573 (KJS::arrayProtoFuncSome):
2575 (KJS::FunctionImp::callAsFunction):
2576 (KJS::ActivationImp::toThisObject):
2577 (KJS::globalFuncEval):
2578 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
2579 (KJS::PrototypeReflexiveFunction::mark):
2581 (KJS::PrototypeReflexiveFunction::cachedGlobalObject):
2582 * kjs/function_object.cpp:
2583 (KJS::functionProtoFuncApply):
2584 (KJS::functionProtoFuncCall):
2586 (KJS::ExpressionNode::resolveAndCall):
2587 (KJS::FunctionCallValueNode::evaluate):
2588 (KJS::LocalVarFunctionCallNode::inlineEvaluate):
2589 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
2590 (KJS::FunctionCallBracketNode::evaluate):
2591 (KJS::FunctionCallDotNode::inlineEvaluate):
2593 (KJS::JSObject::call):
2594 (KJS::JSObject::put):
2595 (KJS::tryGetAndCallProperty):
2596 (KJS::JSObject::lookupGetter):
2597 (KJS::JSObject::lookupSetter):
2598 (KJS::JSObject::toThisObject):
2599 (KJS::JSObject::toGlobalObject):
2600 (KJS::JSObject::fillGetterPropertySlot):
2602 * kjs/object_object.cpp:
2603 (KJS::objectProtoFuncLookupGetter):
2604 (KJS::objectProtoFuncLookupSetter):
2605 * kjs/string_object.cpp:
2608 2008-04-08 Brady Eidson <beidson@apple.com>
2610 Encourage Windows to rebuild - AGAIN...
2614 2008-04-08 Adam Roben <aroben@apple.com>
2618 * JavaScriptCore.exp: Add callOnMainThread, and sorted the list.
2620 2008-04-08 Brady Eidson <beidson@apple.com>
2622 Rubberstamped by Adam Roben
2624 Touch some files to *strongly* encourage Windows to rebuilt with DOM_STORAGE enabled
2628 2008-04-08 Adam Roben <aroben@apple.com>
2630 Move callOnMainThread to WTF
2632 Reviewed by Alexey Proskuryakov.
2635 * JavaScriptCore.pri:
2636 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2637 * JavaScriptCore.xcodeproj/project.pbxproj:
2638 * JavaScriptCoreSources.bkl:
2641 * wtf/MainThread.cpp:
2643 * wtf/gtk/MainThreadGtk.cpp:
2644 * wtf/mac/MainThreadMac.mm:
2645 * wtf/qt/MainThreadQt.cpp:
2646 * wtf/win/MainThreadWin.cpp:
2647 * wtf/wx/MainThreadWx.cpp:
2648 Moved here from WebCore/platform. Replaced all instances of "WebCore"
2651 * kjs/bool_object.cpp: Touched to force JavaScriptCore.vcproj to
2653 to the WTF namespace.
2654 * wtf/ThreadingWin.cpp:
2655 (WTF::initializeThreading): Call initializeMainThread.
2657 2008-04-07 Brady Eidson <beidson@apple.com>
2659 Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
2661 * Configurations/JavaScriptCore.xcconfig:
2663 2008-04-07 Adam Roben <aroben@apple.com>
2667 * wtf/ThreadingWin.cpp: Back out some changes I didn't mean to land.
2669 2008-04-07 Adam Roben <aroben@apple.com>
2671 Add WTF::isMainThread
2673 Reviewed by Alexey Proskuryakov.
2675 * wtf/Threading.h: Declare the new function.
2676 * wtf/ThreadingGtk.cpp:
2677 (WTF::initializeThreading): Initialize the main thread identifier.
2678 (WTF::isMainThread): Added.
2679 * wtf/ThreadingNone.cpp: Ditto ThreadingGtk.cpp.
2680 (WTF::initializeThreading):
2681 (WTF::isMainThread):
2682 * wtf/ThreadingPthreads.cpp: Ditto.
2683 (WTF::initializeThreading):
2684 (WTF::isMainThread):
2685 * wtf/ThreadingWin.cpp: Ditto.
2686 (WTF::initializeThreading):
2687 (WTF::isMainThread):
2689 2008-04-06 Alexey Proskuryakov <ap@webkit.org>
2693 Make UString thread-safe.
2695 No change on SunSpider total, although individual tests have changed a lot, up to 3%.
2697 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Call UString::null() to initialize
2700 * kjs/identifier.cpp:
2701 (KJS::CStringTranslator::translate):
2702 (KJS::UCharBufferTranslator::translate):
2703 Use "true" for a boolean value instead of 1, because it's C++.
2706 (KJS::CString::adopt): Added a method to create from a char* buffer without copying.
2707 (KJS::UString::Rep::ref): Removed an assertion for JSLock::lockCount, as it's no longer
2708 necessary to hold JSLock when working with strings.
2709 (KJS::UString::Rep::deref): Ditto.
2710 (KJS::UString::Rep::isStatic): Added a field to quickly determine that this is an empty
2711 or null static string.
2714 (KJS::): Removed normalStatBufferSize and statBufferSize, as there is no reason to have such
2715 an advanced implementation of a debug-only ascii() method. Removed a long-obsolete comment
2717 (KJS::UString::Rep::createCopying): Removed an assertion for JSLock::lockCount.
2718 (KJS::UString::Rep::create): Ditto.
2719 (KJS::UString::Rep::destroy): Ditto. Do not do anything for static null and empty strings,
2720 as refcounting is not reliable for those. Reordered branches for a noticeable speed gain -
2721 apparently this functiton is hot enough for SunSpider to see an effect from this!
2722 (KJS::UString::null): Moved a star, added a comment.
2723 (KJS::UString::cstring): Reimplemented to not call ascii(), which is not thread-safe.
2724 (KJS::UString::ascii): Simplified statBuffer handling logic.
2725 (KJS::UString::toDouble): Use cstring() instead of ascii().
2727 2008-04-02 Mark Rowe <mrowe@apple.com>
2729 Reviewed by Oliver Hunt.
2731 Ensure that debug symbols are generated for x86_64 and ppc64 builds.
2733 * Configurations/Base.xcconfig:
2735 2008-04-01 Christian Dywan <christian@imendio.com>
2737 Build fix for GCC 4.3.
2739 * wtf/unicode/icu/CollatorICU.cpp: include string.h
2741 2008-04-01 Alexey Proskuryakov <ap@webkit.org>
2743 Rubber-stamped by Darin.
2745 Turn off using 64-bit arithmetic on 32-bit hardware, as dtoa own code is faster than
2746 compiler-provided emulation.
2748 1% speedup on Acid3 test 26.
2752 2008-04-01 Alexey Proskuryakov <ap@webkit.org>
2756 Make MathExtras.h thread safe.
2758 * kjs/math_object.cpp:
2759 (KJS::mathProtoFuncRandom): If threading is enabled, rely on initializeThreading to call
2763 * wtf/ThreadingGtk.cpp:
2764 (WTF::initializeThreading):
2765 * wtf/ThreadingNone.cpp:
2766 (WTF::initializeThreading):
2767 * wtf/ThreadingPthreads.cpp:
2768 (WTF::initializeThreading):
2769 * wtf/ThreadingWin.cpp:
2770 (WTF::initializeThreading):
2771 Call wtf_random_init(); made the function non-inline to avoid having to include too many
2772 headers in Threading.h.
2774 2008-03-31 Eric Seidel <eric@webkit.org>
2778 Make matching of regexps using ^ much faster
2779 http://bugs.webkit.org/show_bug.cgi?id=18086
2781 * pcre/pcre_compile.cpp:
2783 (branchNeedsLineStart):
2784 * pcre/pcre_exec.cpp:
2787 * pcre/pcre_internal.h:
2789 2008-03-29 Alexey Proskuryakov <ap@webkit.org>
2791 Reviewed by Oliver Hunt.
2793 <rdar://problem/5829556> REGRESSION: Leak in KJS::initializeThreading()
2795 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): There is no guarantee that
2796 initializeThreading() is called only once; check that the mutex hasn't been already allocated.
2798 2008-03-29 Oliver Hunt <oliver@apple.com>
2802 Bug 17924: Crash in KJS::ConstDeclNode::evaluate with |with| and |const|
2803 <http://bugs.webkit.org/show_bug.cgi?id=17924>
2804 <rdar://problem/5806933>
2806 It turns out this is trivially avoidable if we just match firefox's
2807 semantics and ensure that an assignment in a const declaration always
2808 writes to the variable object.
2811 (KJS::ConstDeclNode::handleSlowCase):
2813 2008-03-28 Alexey Proskuryakov <ap@webkit.org>
2815 Reviewed by Sam Weinig.
2817 Fix a dtoa thread safety issue.
2819 WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety
2820 compiled in for dtoa.
2822 This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with
2823 his recent improvement.
2828 Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was
2829 in the presence of locking (but somewhat slower in single-threaded case).
2830 (Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to
2831 restructure the code to avoid significant performance implications).
2832 (Bigint::lshift): Rewrote to avoid an allocation, if possible.
2835 (Bigint::kjs_freedtoa):
2837 Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS.
2839 * kjs/InitializeThreading.cpp: Added.
2840 (KJS::initializeThreading):
2841 * kjs/InitializeThreading.h: Added.
2842 Initialize threading at KJS level, if enabled.
2844 * kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading.
2846 * kjs/testkjs.cpp: (kjsmain): Call initializeThreading.
2848 * JavaScriptCore.exp: Export KJS::initializeThreading.
2851 * JavaScriptCore.exp:
2852 * JavaScriptCore.pri:
2853 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2854 * JavaScriptCoreSources.bkl:
2855 * JavaScriptCore.xcodeproj/project.pbxproj:
2856 Added InitializeThreading.{h,cpp}.
2858 * wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only
2859 to be called from KJS::initializeThreading, and having it in the global namespace is useless.
2861 2008-03-28 Brady Eidson <beidson@apple.com>
2865 Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore
2867 * JavaScriptCore.exp:
2868 * JavaScriptCore.xcodeproj/project.pbxproj:
2870 2008-03-27 Darin Adler <darin@apple.com>
2872 Reviewed by Mark Rowe.
2874 <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
2875 compiled length calculated incorrectly.
2877 * pcre/pcre_compile.cpp:
2878 (multiplyWithOverflowCheck):
2879 (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
2880 and bail with an error rather than returning incorrect results.
2882 2008-03-26 Mark Rowe <mrowe@apple.com>
2884 Rubber-stamped by Brady Eidson.
2886 Update FEATURE_DEFINES to be consistent with the other locations in which it is defined.
2888 * Configurations/JavaScriptCore.xcconfig:
2890 2008-03-26 Adam Roben <aroben@apple.com>
2892 Fix Bug 18060: Assertion failure (JSLock not held) beneath
2893 JSCallbackObject<Base>::toString
2895 <http://bugs.webkit.org/show_bug.cgi?id=18060>
2897 Reviewed by Geoff Garen.
2901 * API/JSCallbackObjectFunctions.h:
2902 (KJS::JSCallbackObject<Base>::toString): Make the DropAllLocks
2903 instance only be in scope while calling convertToType.
2908 (MyObject_convertToType): Implement type conversion to string.
2909 * API/testapi.js: Add a test for type conversion to string.
2911 2008-03-26 Adam Roben <aroben@apple.com>
2915 * kjs/array_instance.cpp: Touched this.
2916 * wtf/HashFunctions.h:
2917 (WTF::intHash): Added 8- and 16-bit versions of intHash.
2919 2008-03-26 Adam Roben <aroben@apple.com>
2921 Force JSC headers to be copied by touching a file
2923 * kjs/array_instance.cpp:
2924 (KJS::ArrayInstance::getPropertyNames):
2926 2008-03-26 Adam Roben <aroben@apple.com>
2928 Windows build fix after r31324
2932 Added HashTable plumbing to support using wchar_t as a key type.
2934 * wtf/HashFunctions.h:
2938 2008-03-26 Maciej Stachowiak <mjs@apple.com>
2942 - JSC part of fix for "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)"
2943 http://bugs.webkit.org/show_bug.cgi?id=18118
2945 * wtf/HashFunctions.h:
2950 2008-03-26 Alexey Proskuryakov <ap@webkit.org>
2954 Cache C string identifiers by address, not value, assuming that C strings can only
2957 1% speedup on Acid3 test 26.
2959 * kjs/identifier.cpp:
2960 (KJS::literalIdentifierTable):
2961 (KJS::Identifier::add):
2962 Added a new table to cache UString::Reps created from C strings by address. Elements are
2963 never removed from this cache, as only predefined identifiers can get there.
2966 (KJS::Identifier::Identifier): Added a warning.
2968 2008-03-26 Alexey Proskuryakov <ap@webkit.org>
2970 Rubber-stamped by Maciej.
2972 An assertion was failing in function-toString-object-literals.html when parsing 1e-500.
2973 The condition existed before, and got uncovered by turning compiled-out dtoa checks into
2976 The assertion was verifying that the caller wasn't constructing a Bigint from 0.
2977 This might have had some reason behind it originally, but I couldn't find any,
2978 and this doesn't look like a reasonable requirement.
2980 * kjs/dtoa.cpp: (d2b): Removed the assertion (two copies in different code paths).
2982 2008-03-25 Adam Roben <aroben@apple.com>
2984 Fix Bug 18077: Integrate testapi.c into the Windows build
2986 <http://bugs.webkit.org/show_bug.cgi?id=18077>
2988 Reviewed by Steve Falkenburg.
2990 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Added.
2992 2008-03-25 Adam Roben <aroben@apple.com>
2994 Make testapi.c compile under MSVC
2996 Currently you must compile testapi.c as C++ code since MSVC does not
2997 support many C features that GCC does.
2999 Reviewed by Steve Falkenburg.
3002 (nan): Added an implementation of this for MSVC.
3003 (assertEqualsAsUTF8String): Use malloc instead of dynamically-sized
3005 (assertEqualsAsCharactersPtr): Ditto.
3006 (print_callAsFunction): Ditto.
3007 (main): Ditto, and explicitly cast from UniChar* to JSChar*.
3009 2008-03-25 Adam Roben <aroben@apple.com>
3011 Stop using JavaScriptCore's custom stdbool.h and stdint.h on Windows
3013 We can't remove the os-win32 directory yet because other ports (at
3014 least wx) are still relying on it.
3016 Reviewed by Steve Falkenburg.
3018 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3019 - Made all the include paths match the one for the Debug
3020 configuration (these got out of sync in r30797)
3021 - Removed os-win32 from the include path
3022 - Removed os-win32 from the directories we copy to $WebKitOutputDir.
3023 - Removed stdint.h from the project
3024 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3025 Delete the files that we may have previously copied from the os-win32
3028 2008-03-25 Alexey Proskuryakov <ap@webkit.org>
3032 * kjs/dtoa.cpp: Include stdint.h.
3034 2008-03-25 Alexey Proskuryakov <ap@webkit.org>
3036 Rubber-stamped by Darin.
3038 Cleanup dtoa.cpp style.
3060 (Bigint::kjs_strtod):
3063 (Bigint::nrv_alloc):
3064 (Bigint::kjs_freedtoa):
3068 2008-03-24 Darin Adler <darin@apple.com>
3072 - convert a JavaScript immediate number to a string more efficiently
3074 2% speedup of Acid3 test 26
3076 * kjs/JSImmediate.cpp:
3077 (KJS::JSImmediate::toString): Take advantage of the fact that all immediate
3078 numbers are integers, and use the faster UString function for formatting integers
3079 instead of the slower one that works for floating point. I think this is a leftover
3080 from when immediate numbers were floating point.
3082 2008-03-23 Sam Weinig <sam@webkit.org>
3084 Reviewed by Darin Adler.
3086 Fix http://bugs.webkit.org/show_bug.cgi?id=18048
3087 The "thisObject" parameter to JSEvaluateScript is not used properly
3089 Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created
3093 (main): Add tests for setting the thisObject when calling JSEvaluateScript.
3095 * kjs/ExecState.cpp:
3096 (KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment.
3098 2008-03-22 Jesse Ruderman <jruderman@gmail.com>
3100 Reviewed by Sam Weinig. Landed by eseidel.
3102 Make testkjs flush stdout after printing.
3104 * JavaScriptCore.xcodeproj/project.pbxproj:
3108 2008-03-21 Oliver Hunt <oliver@apple.com>
3112 Optimise lookup of Math, undefined, NaN and Infinity
3114 Added a method to JSVariableObject to allow us to inject DontDelete properties
3115 into the symbol table and localStorage. This results in a 0.4% progression in
3116 SunSpider, with a 8% gain in math-partial-sums.
3118 * kjs/JSGlobalObject.cpp:
3119 (KJS::JSGlobalObject::reset):
3120 * kjs/JSVariableObject.h:
3121 (KJS::JSVariableObject::symbolTableInsert):
3123 2008-03-21 Oliver Hunt <oliver@apple.com>
3125 Reviewed by Geoff Garen.
3127 Global properties that use LocalStorage are not correctly listed as enumerable.
3129 The problem was caused by JSObject::getPropertyAttributes not being aware
3130 of the JSVariableObject SymbolTable. The fix is to make getPropertyAttributes
3131 virtual and override in JSVariableObject. This does not produce any performance
3134 * JavaScriptCore.exp:
3135 * kjs/JSVariableObject.cpp:
3136 (KJS::JSVariableObject::getPropertyNames):
3137 (KJS::JSVariableObject::getPropertyAttributes):
3138 * kjs/JSVariableObject.h:
3141 2008-03-21 Arkadiusz Miskiewicz <arekm@maven.pl>
3143 Webkit does not build on linux powerpc
3145 <http://bugs.webkit.org/show_bug.cgi?id=17019>
3147 Reviewed by David Kilzer.
3150 (TCMalloc_SpinLock::Unlock):
3152 2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com>
3156 http://bugs.webkit.org/show_bug.cgi?id=17981
3158 Add javascriptcore_cppflags to Programs_minidom_CPPFLAGS.
3162 2008-03-21 Alexey Proskuryakov <ap@webkit.org>
3164 Reviewed by Oliver Hunt.
3166 Consolidate static identifier initializers within CommonIdentifiers.
3168 No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).
3170 * kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized
3171 throughout the code.
3173 * kjs/date_object.cpp:
3174 (KJS::DateObjectImp::DateObjectImp):
3175 * kjs/function_object.cpp:
3176 (KJS::FunctionPrototype::FunctionPrototype):
3177 * kjs/object_object.cpp:
3178 (KJS::ObjectPrototype::ObjectPrototype):
3179 * kjs/regexp_object.cpp:
3180 (KJS::RegExpPrototype::RegExpPrototype):
3181 Use the values from CommonIdentifiers.
3183 * kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
3186 (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
3189 (wtf_atan2): Having local variables for numeric_limits constants is good for readability,
3190 but there is no reason to keep them static.
3192 * JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head.
3194 2008-03-20 Oliver Hunt <oliver@apple.com>
3198 Fix for leak introduced by inline ScopeChainNode use
3200 To avoid any extra branches when managing an inline ScopeChainNode
3201 in the ScopeChain the inline node gets inserted with a refcount of
3202 2. This meant than when the ScopeChain was destroyed the ScopeChainNodes
3203 above the inline node would be leaked.
3205 We resolve this by manually popping the inline node in the
3206 FunctionExecState destructor.
3208 * JavaScriptCore.xcodeproj/project.pbxproj:
3209 * kjs/ExecStateInlines.h:
3210 (KJS::FunctionExecState::~FunctionExecState):
3211 * kjs/scope_chain.h:
3212 (KJS::ScopeChain::popInlineScopeNode):
3214 2008-03-20 Mark Rowe <mrowe@apple.com>
3216 Reviewed by Sam Weinig.
3218 Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
3219 This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
3222 * Configurations/JavaScriptCore.xcconfig:
3224 2008-03-20 David Krause <david.krause@gmail.com>
3226 Reviewed by David Kilzer.
3228 Fix http://bugs.webkit.org/show_bug.cgi?id=17923
3229 Bug 17923: ARM platform endian defines inaccurate
3232 Replaced !defined(__ARMEL__) check with !defined(__VFP_FP__)
3233 for PLATFORM(MIDDLE_ENDIAN)
3235 2008-03-20 Maciej Stachowiak <mjs@apple.com>
3239 * JavaScriptCore.xcodeproj/project.pbxproj: install Activation.h as private
3241 2008-03-20 Maciej Stachowiak <mjs@apple.com>
3245 - reduce function call overhead for 1.014x speedup on SunSpider
3247 I moved some functions from ExecState.cpp to ExecStateInline.h and
3248 from JSGlobalObject.cpp to JSGlobalObject.h, and declared them
3249 inline; machine function call overhead for these was hurting JS
3250 funcion call overhead.
3252 * kjs/ExecState.cpp:
3253 * kjs/ExecStateInlines.h: Added.
3254 (KJS::ExecState::ExecState):
3255 (KJS::ExecState::~ExecState):
3256 (KJS::FunctionExecState::FunctionExecState):
3257 (KJS::FunctionExecState::~FunctionExecState):
3258 * kjs/JSGlobalObject.cpp:
3259 * kjs/JSGlobalObject.h:
3260 (KJS::JSGlobalObject::pushActivation):
3261 (KJS::JSGlobalObject::checkActivationCount):
3262 (KJS::JSGlobalObject::popActivation):
3265 2008-03-19 Oliver Hunt <oliver@apple.com>
3269 Avoid heap allocating the root scope chain node for eval and closure free functions
3271 Maciej suggested using an inline ScopeChainNode for functions that don't use eval
3272 or closures as they are unable to ever capture the scope chain. This gives us a 2.4%
3273 win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number
3276 * kjs/ExecState.cpp:
3277 (KJS::ExecState::ExecState):
3279 * kjs/scope_chain.h:
3280 (KJS::ScopeChain::push):
3282 2008-03-19 Mark Rowe <mrowe@apple.com>
3284 Reviewed by Sam Weinig.
3288 * kjs/JSGlobalObject.cpp: Add missing #include.
3290 2008-03-19 Sam Weinig <sam@webkit.org>
3292 Reviewed by Anders Carlsson.
3294 Fix for <rdar://problem/5785694>
3295 Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
3297 Make the activeExecStates stack per JSGlobalObject instead of static to ensure
3300 * JavaScriptCore.exp:
3301 * kjs/ExecState.cpp:
3302 (KJS::InterpreterExecState::InterpreterExecState):
3303 (KJS::InterpreterExecState::~InterpreterExecState):
3304 (KJS::EvalExecState::EvalExecState):
3305 (KJS::EvalExecState::~EvalExecState):
3306 (KJS::FunctionExecState::FunctionExecState):
3307 (KJS::FunctionExecState::~FunctionExecState):
3310 * kjs/JSGlobalObject.cpp:
3311 (KJS::JSGlobalObject::mark):
3312 * kjs/JSGlobalObject.h:
3313 (KJS::JSGlobalObject::activeExecStates):
3314 * kjs/collector.cpp:
3315 (KJS::Collector::collect):
3316 (KJS::Collector::reportOutOfMemoryToAllExecStates): Iterate all JSGlobalObjects and report
3317 the OutOfMemory condition to all the ExecStates in each.
3319 2008-03-19 Jasper Bryant-Greene <jasper@unix.geek.nz>
3321 Reviewed by Maciej Stachowiak.
3323 Fix http://bugs.webkit.org/show_bug.cgi?id=17941
3324 Bug 17941: C++-style comments in JavaScriptCore API
3327 Remove C++-style comments from public JavaScriptCore API, replacing
3328 with standard C90 block comments.
3330 2008-03-19 Mark Rowe <mrowe@apple.com>
3332 Reviewed by Oliver Hunt.
3334 Fix http://bugs.webkit.org/show_bug.cgi?id=17939
3335 Bug 17939: Crash decompiling "const a = 1, b;"
3337 * kjs/nodes2string.cpp:
3338 (KJS::ConstDeclNode::streamTo): Null-check the correct variable.
3340 2008-03-18 Oliver Hunt <oliver@apple.com>
3342 Reviewed by Mark Rowe.
3344 Bug 17929: Incorrect decompilation with |const|, comma
3345 http://bugs.webkit.org/show_bug.cgi?id=17929
3347 There were actually two bugs here. First we weren't correctly handling const
3348 nodes with multiple declarations. The second issue was caused by us not
3349 giving the correct precedence to the initialisers.
3351 * kjs/nodes2string.cpp:
3352 (KJS::ConstDeclNode::streamTo):
3354 2008-03-18 Darin Adler <darin@apple.com>
3358 - Speed up JavaScript built-in properties by changing the
3359 hash table to take advantage of the identifier objects
3361 5% speedup for Acid3 test 26
3363 * JavaScriptCore.exp: Updated.
3364 * kjs/create_hash_table: Compute size of hash table large enough so that there
3365 are no collisions, but don't generate the hash table.
3366 * kjs/identifier.h: Made the add function that returns a PassRefPtr public.
3368 (KJS::Lexer::lex): Updated for change to HashTable interface.
3370 (KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for
3371 each property so the equality comparision can be done with pointer comparision.
3372 * kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can
3373 hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed
3374 the Lookup functions to be member functions of HashTable instead.
3376 (KJS::JSObject::deleteProperty): Update for change to HashTable.
3377 (KJS::JSObject::findPropertyHashEntry): Ditto.
3378 (KJS::JSObject::getPropertyAttributes): Ditto.
3379 (KJS::JSObject::getPropertyNames): Ditto.
3381 2008-03-18 Mark Rowe <mrowe@apple.com>
3383 Reviewed by Oliver Hunt.
3385 Fix http://bugs.webkit.org/show_bug.cgi?id=17925 and http://bugs.webkit.org/show_bug.cgi?id=17927.
3386 - Bug 17925: Crash in KJS::JSObject::put after setting this.__proto__
3387 - Bug 17927: Hang after attempting to create circular __proto__
3390 (KJS::JSObject::put): Silently ignore attempts to set __proto__ to a non-object, non-null value.
3391 Return after setting the exception when an attempt to set a cyclic __proto__ is detected so that
3392 the cyclic value is not set.
3394 2008-03-18 Maciej Stachowiak <mjs@apple.com>
3398 - inline ActivationImp::init for 0.8% SunSpider speedup
3401 (KJS::ActivationImp::init): Moved here from function.cpp
3404 2008-03-18 Simon Hausmann <hausmann@webkit.org>
3408 Including config.h like in the other .cpp files gets the #ifdeffery
3411 * kjs/JSWrapperObject.cpp:
3413 2008-03-17 Darin Adler <darin@apple.com>
3417 JavaScriptCore changes to support a WebCore speedup.
3419 * JavaScriptCore.exp: Export the UString::Rep::computeHash function.
3420 * wtf/HashSet.h: Added a find and contains function that take a translator,
3421 like the add function.
3423 2008-03-18 Maciej Stachowiak <mjs@apple.com>
3427 - a few micro-optimizations for 1.2% SunSpider speedup
3430 (KJS::FunctionImp::callAsFunction): check for Return completion before Throw,
3433 (KJS::JSObject::put): When walking prototype chain, instead of
3434 checking isObject (a virtual call), compare to jsNull (compare to
3435 a constant) since null is the only non-object that can be in a
3438 2008-03-17 Oliver Hunt <oliver@apple.com>
3442 Optimise multi-scope function call resolution
3444 Refactor multiscope variable resolution and use to add
3445 optimised FunctionCallResolveNode subclasses.
3447 2.6% gain in sunspider performance, *25%* gain in controlflow-recursive
3450 (KJS::getSymbolTableEntry):
3451 (KJS::ResolveNode::optimizeVariableAccess):
3452 (KJS::getNonLocalSymbol):
3453 (KJS::ExpressionNode::resolveAndCall):
3454 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
3455 (KJS::FunctionCallResolveNode::inlineEvaluate):
3456 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
3457 (KJS::ScopedVarFunctionCallNode::evaluate):
3458 (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
3459 (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
3460 (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
3461 (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
3462 (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
3463 (KJS::NonLocalVarFunctionCallNode::evaluate):
3464 (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
3465 (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
3466 (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
3467 (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
3469 (KJS::ScopedVarFunctionCallNode::):
3470 (KJS::NonLocalVarFunctionCallNode::):
3472 2008-03-17 David Kilzer <ddkilzer@apple.com>
3474 Don't define PLATFORM(MIDDLE_ENDIAN) on little endian ARM.
3478 See <http://bugs.webkit.org/show_bug.cgi?id=15416#c13>.
3480 * wtf/Platform.h: Added check for !defined(__ARMEL__) when defining
3481 PLATFORM(MIDDLE_ENDIAN).
3483 2008-03-17 Oliver Hunt <oliver@apple.com>
3485 Reviewed by Geoff, Darin and Weinig.
3487 Add fast multi-level scope lookup
3489 Add logic and AST nodes to provide rapid variable resolution across
3490 static scope boundaries. This also adds logic that allows us to skip
3491 any static scopes that do not contain the variable to be resolved.
3493 This results in a ~2.5% speedup in SunSpider, and gives a 25-30% speedup
3494 in some simple and ad hoc closure and global variable access tests.
3496 * JavaScriptCore.exp:
3498 * kjs/JSGlobalObject.cpp:
3499 * kjs/JSGlobalObject.h:
3500 * kjs/JSVariableObject.cpp:
3501 * kjs/JSVariableObject.h:
3503 (KJS::ActivationImp::isDynamicScope):
3505 (KJS::ResolveNode::optimizeVariableAccess):
3506 (KJS::ScopedVarAccessNode::inlineEvaluate):
3507 (KJS::ScopedVarAccessNode::evaluate):
3508 (KJS::ScopedVarAccessNode::evaluateToNumber):
3509 (KJS::ScopedVarAccessNode::evaluateToBoolean):
3510 (KJS::ScopedVarAccessNode::evaluateToInt32):
3511 (KJS::ScopedVarAccessNode::evaluateToUInt32):
3512 (KJS::NonLocalVarAccessNode::inlineEvaluate):
3513 (KJS::NonLocalVarAccessNode::evaluate):
3514 (KJS::NonLocalVarAccessNode::evaluateToNumber):
3515 (KJS::NonLocalVarAccessNode::evaluateToBoolean):
3516 (KJS::NonLocalVarAccessNode::evaluateToInt32):
3517 (KJS::NonLocalVarAccessNode::evaluateToUInt32):
3518 (KJS::IfElseNode::optimizeVariableAccess):
3519 (KJS::ScopeNode::optimizeVariableAccess):
3521 (KJS::ScopedVarAccessNode::):
3522 (KJS::NonLocalVarAccessNode::):
3525 2008-03-16 weihongzeng <weihong.zeng@hotmail.com>
3527 Reviewed by Darin Adler.
3529 http://bugs.webkit.org/show_bug.cgi?id=15416
3530 Add support for mixed-endian processors
3532 * kjs/dtoa.cpp: Add IEEE_ARM, triggered by PLATFORM(MIDDLE_ENDIAN).
3534 2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
3536 Rubber stamped by Darin.
3538 Add set-webkit-configuration support for wx port, and centralize
3539 build dir location setting.
3541 http://bugs.webkit.org/show_bug.cgi?id=17790