1 2008-05-13 Alexey Proskuryakov <ap@webkit.org>
3 Reviewed by Geoffrey Garen.
5 <rdar://problem/4949018> JavaScriptCore API claims to work with UTF8 strings, but only works
10 (KJS::UString::Rep::createFromUTF8):
11 Added. Implementation adapted from JSStringCreateWithUTF8CString().
13 * API/JSStringRef.cpp:
14 (JSStringCreateWithUTF8CString):
16 (OpaqueJSClass::OpaqueJSClass):
17 Use UString::Rep::createFromUTF8().
19 2008-05-12 Mark Rowe <mrowe@apple.com>
21 Reviewed by Tim Hatcher.
23 <rdar://problem/4859666> WebKit needs availability macros in order to deprecate APIs
25 Create WebKit availability macros that key off the Mac OS X version being targeted to
26 determine the WebKit version being targeted. Applications can define
27 WEBKIT_VERSION_MIN_REQUIRED before including WebKit headers in order to target a specific
30 The availability header is being added to JavaScriptCore rather than WebKit as JavaScriptCore
31 is the lowest-level portion of the public WebKit API.
33 * API/WebKitAvailability.h: Added.
34 * JavaScriptCore.xcodeproj/project.pbxproj:
36 2008-05-12 Alexey Proskuryakov <ap@webkit.org>
40 https://bugs.webkit.org/show_bug.cgi?id=18828
41 Reproducible crash with PAC file
43 Naively moving JavaScriptCore into thread-specific data was inappropriate in the face of
44 exiting JavaScriptCore API clients, which expect a different therading model. Temporarily
45 disabling ThreadSpecific implementation until this can be sorted out.
47 * wtf/ThreadSpecific.h:
48 (WTF::::ThreadSpecific):
49 (WTF::::~ThreadSpecific):
53 2008-05-12 Alexey Proskuryakov <ap@webkit.org>
55 Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
60 * API/JSCallbackObjectFunctions.h:
61 (KJS::::staticFunctionGetter):
63 (OpaqueJSClass::prototype):
64 * API/JSObjectRef.cpp:
66 (JSObjectMakeFunctionWithCallback):
67 (JSObjectMakeConstructor):
68 (JSObjectMakeFunction):
74 * kjs/InitializeThreading.cpp:
75 (KJS::initializeThreadingOnce):
76 * kjs/JSGlobalObject.cpp:
77 (KJS::JSGlobalObject::~JSGlobalObject):
78 (KJS::JSGlobalObject::init):
79 (KJS::JSGlobalObject::put):
80 (KJS::JSGlobalObject::reset):
81 (KJS::JSGlobalObject::tearOffActivation):
82 * kjs/JSGlobalObject.h:
83 (KJS::JSGlobalObject::head):
84 (KJS::JSGlobalObject::perThreadData):
86 (KJS::JSLock::registerThread):
88 (KJS::JSLock::JSLock):
89 * kjs/array_instance.cpp:
90 (KJS::ArrayInstance::ArrayInstance):
91 (KJS::ArrayInstance::lengthGetter):
92 * kjs/array_object.cpp:
93 (KJS::arrayProtoFuncToString):
94 (KJS::arrayProtoFuncToLocaleString):
95 (KJS::arrayProtoFuncJoin):
96 (KJS::arrayProtoFuncConcat):
97 (KJS::arrayProtoFuncPop):
98 (KJS::arrayProtoFuncPush):
99 (KJS::arrayProtoFuncShift):
100 (KJS::arrayProtoFuncSlice):
101 (KJS::arrayProtoFuncSplice):
102 (KJS::arrayProtoFuncUnShift):
103 (KJS::arrayProtoFuncFilter):
104 (KJS::arrayProtoFuncMap):
105 (KJS::arrayProtoFuncEvery):
106 (KJS::arrayProtoFuncForEach):
107 (KJS::arrayProtoFuncSome):
108 (KJS::arrayProtoFuncIndexOf):
109 (KJS::arrayProtoFuncLastIndexOf):
110 (KJS::ArrayObjectImp::ArrayObjectImp):
111 (KJS::ArrayObjectImp::construct):
112 * kjs/bool_object.cpp:
113 (KJS::BooleanPrototype::BooleanPrototype):
114 (KJS::booleanProtoFuncToString):
115 (KJS::BooleanObjectImp::BooleanObjectImp):
116 (KJS::BooleanObjectImp::construct):
119 (KJS::allocateBlock):
120 (KJS::Collector::recordExtraCost):
121 (KJS::Collector::heapAllocate):
122 (KJS::Collector::allocate):
123 (KJS::Collector::allocateNumber):
124 (KJS::Collector::registerAsMainThread):
126 (KJS::PlatformThread::PlatformThread):
127 (KJS::getCurrentPlatformThread):
128 (KJS::Collector::Thread::Thread):
129 (KJS::destroyRegisteredThread):
130 (KJS::initializeRegisteredThreadKey):
131 (KJS::Collector::registerThread):
132 (KJS::Collector::markStackObjectsConservatively):
133 (KJS::Collector::markCurrentThreadConservativelyInternal):
134 (KJS::Collector::markCurrentThreadConservatively):
135 (KJS::suspendThread):
137 (KJS::getPlatformThreadRegisters):
138 (KJS::otherThreadStackPointer):
139 (KJS::Collector::markOtherThreadConservatively):
140 (KJS::protectedValues):
141 (KJS::Collector::protect):
142 (KJS::Collector::unprotect):
143 (KJS::Collector::collectOnMainThreadOnly):
144 (KJS::Collector::markProtectedObjects):
145 (KJS::Collector::markMainThreadOnlyObjects):
146 (KJS::Collector::sweep):
147 (KJS::Collector::collect):
148 (KJS::Collector::size):
149 (KJS::Collector::globalObjectCount):
150 (KJS::Collector::protectedGlobalObjectCount):
151 (KJS::Collector::protectedObjectCount):
152 (KJS::Collector::protectedObjectTypeCounts):
153 (KJS::Collector::isBusy):
154 (KJS::Collector::reportOutOfMemoryToAllExecStates):
157 (KJS::Collector::cellBlock):
158 (KJS::Collector::cellOffset):
159 (KJS::Collector::isCellMarked):
160 (KJS::Collector::markCell):
161 (KJS::Collector::reportExtraMemoryCost):
162 * kjs/date_object.cpp:
163 (KJS::formatLocaleDate):
164 (KJS::DatePrototype::DatePrototype):
165 (KJS::DateObjectImp::DateObjectImp):
166 (KJS::DateObjectImp::construct):
167 (KJS::DateObjectImp::callAsFunction):
168 (KJS::DateObjectFuncImp::DateObjectFuncImp):
169 (KJS::DateObjectFuncImp::callAsFunction):
170 (KJS::dateProtoFuncToString):
171 (KJS::dateProtoFuncToUTCString):
172 (KJS::dateProtoFuncToDateString):
173 (KJS::dateProtoFuncToTimeString):
174 (KJS::dateProtoFuncToLocaleString):
175 (KJS::dateProtoFuncToLocaleDateString):
176 (KJS::dateProtoFuncToLocaleTimeString):
177 (KJS::dateProtoFuncValueOf):
178 (KJS::dateProtoFuncGetTime):
179 (KJS::dateProtoFuncGetFullYear):
180 (KJS::dateProtoFuncGetUTCFullYear):
181 (KJS::dateProtoFuncToGMTString):
182 (KJS::dateProtoFuncGetMonth):
183 (KJS::dateProtoFuncGetUTCMonth):
184 (KJS::dateProtoFuncGetDate):
185 (KJS::dateProtoFuncGetUTCDate):
186 (KJS::dateProtoFuncGetDay):
187 (KJS::dateProtoFuncGetUTCDay):
188 (KJS::dateProtoFuncGetHours):
189 (KJS::dateProtoFuncGetUTCHours):
190 (KJS::dateProtoFuncGetMinutes):
191 (KJS::dateProtoFuncGetUTCMinutes):
192 (KJS::dateProtoFuncGetSeconds):
193 (KJS::dateProtoFuncGetUTCSeconds):
194 (KJS::dateProtoFuncGetMilliSeconds):
195 (KJS::dateProtoFuncGetUTCMilliseconds):
196 (KJS::dateProtoFuncGetTimezoneOffset):
197 (KJS::dateProtoFuncSetTime):
198 (KJS::setNewValueFromTimeArgs):
199 (KJS::setNewValueFromDateArgs):
200 (KJS::dateProtoFuncSetYear):
201 (KJS::dateProtoFuncGetYear):
202 * kjs/error_object.cpp:
203 (KJS::ErrorPrototype::ErrorPrototype):
204 (KJS::errorProtoFuncToString):
205 (KJS::ErrorObjectImp::ErrorObjectImp):
206 (KJS::ErrorObjectImp::construct):
207 (KJS::NativeErrorPrototype::NativeErrorPrototype):
208 (KJS::NativeErrorImp::NativeErrorImp):
209 (KJS::NativeErrorImp::construct):
211 (KJS::FunctionImp::lengthGetter):
212 (KJS::FunctionImp::construct):
213 (KJS::Arguments::Arguments):
214 (KJS::ActivationImp::createArgumentsObject):
217 (KJS::globalFuncParseInt):
218 (KJS::globalFuncParseFloat):
219 (KJS::globalFuncEscape):
220 (KJS::globalFuncUnescape):
221 (KJS::PrototypeFunction::PrototypeFunction):
222 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
223 * kjs/function_object.cpp:
224 (KJS::FunctionPrototype::FunctionPrototype):
225 (KJS::functionProtoFuncToString):
226 (KJS::FunctionObjectImp::FunctionObjectImp):
227 (KJS::FunctionObjectImp::construct):
229 (KJS::StringImp::toObject):
231 (KJS::StringImp::StringImp):
232 (KJS::NumberImp::operator new):
234 (KJS::List::markSet):
235 (KJS::List::markProtectedListsSlowCase):
236 (KJS::List::expandAndAppend):
240 (KJS::List::markProtectedLists):
242 (KJS::staticFunctionGetter):
243 (KJS::cacheGlobalObject):
244 * kjs/math_object.cpp:
245 (KJS::MathObjectImp::getValueProperty):
246 (KJS::mathProtoFuncAbs):
247 (KJS::mathProtoFuncACos):
248 (KJS::mathProtoFuncASin):
249 (KJS::mathProtoFuncATan):
250 (KJS::mathProtoFuncATan2):
251 (KJS::mathProtoFuncCeil):
252 (KJS::mathProtoFuncCos):
253 (KJS::mathProtoFuncExp):
254 (KJS::mathProtoFuncFloor):
255 (KJS::mathProtoFuncLog):
256 (KJS::mathProtoFuncMax):
257 (KJS::mathProtoFuncMin):
258 (KJS::mathProtoFuncPow):
259 (KJS::mathProtoFuncRandom):
260 (KJS::mathProtoFuncRound):
261 (KJS::mathProtoFuncSin):
262 (KJS::mathProtoFuncSqrt):
263 (KJS::mathProtoFuncTan):
265 (KJS::ParserRefCounted::ParserRefCounted):
266 (KJS::ParserRefCounted::ref):
267 (KJS::ParserRefCounted::deref):
268 (KJS::ParserRefCounted::refcount):
269 (KJS::ParserRefCounted::deleteNewObjects):
270 (KJS::Node::handleException):
271 (KJS::NumberNode::evaluate):
272 (KJS::StringNode::evaluate):
273 (KJS::ArrayNode::evaluate):
274 (KJS::PostIncResolveNode::evaluate):
275 (KJS::PostIncLocalVarNode::evaluate):
276 (KJS::PostDecResolveNode::evaluate):
277 (KJS::PostDecLocalVarNode::evaluate):
278 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
279 (KJS::PostIncBracketNode::evaluate):
280 (KJS::PostDecBracketNode::evaluate):
281 (KJS::PostIncDotNode::evaluate):
282 (KJS::PostDecDotNode::evaluate):
283 (KJS::typeStringForValue):
284 (KJS::LocalVarTypeOfNode::evaluate):
285 (KJS::TypeOfResolveNode::evaluate):
286 (KJS::TypeOfValueNode::evaluate):
287 (KJS::PreIncLocalVarNode::evaluate):
288 (KJS::PreIncResolveNode::evaluate):
289 (KJS::PreDecLocalVarNode::evaluate):
290 (KJS::PreDecResolveNode::evaluate):
291 (KJS::PreIncConstNode::evaluate):
292 (KJS::PreDecConstNode::evaluate):
293 (KJS::PostIncConstNode::evaluate):
294 (KJS::PostDecConstNode::evaluate):
295 (KJS::PreIncBracketNode::evaluate):
296 (KJS::PreDecBracketNode::evaluate):
297 (KJS::PreIncDotNode::evaluate):
298 (KJS::PreDecDotNode::evaluate):
299 (KJS::NegateNode::evaluate):
300 (KJS::BitwiseNotNode::evaluate):
301 (KJS::MultNode::evaluate):
302 (KJS::DivNode::evaluate):
303 (KJS::ModNode::evaluate):
306 (KJS::AddNumbersNode::evaluate):
307 (KJS::AddStringsNode::evaluate):
308 (KJS::AddStringLeftNode::evaluate):
309 (KJS::AddStringRightNode::evaluate):
310 (KJS::SubNode::evaluate):
311 (KJS::LeftShiftNode::evaluate):
312 (KJS::RightShiftNode::evaluate):
313 (KJS::UnsignedRightShiftNode::evaluate):
314 (KJS::BitXOrNode::evaluate):
315 (KJS::BitOrNode::evaluate):
316 (KJS::valueForReadModifyAssignment):
317 (KJS::ForInNode::execute):
318 (KJS::TryNode::execute):
319 (KJS::FuncDeclNode::makeFunction):
320 (KJS::FuncExprNode::evaluate):
322 * kjs/number_object.cpp:
323 (KJS::NumberPrototype::NumberPrototype):
324 (KJS::numberProtoFuncToString):
325 (KJS::numberProtoFuncToLocaleString):
326 (KJS::numberProtoFuncToFixed):
327 (KJS::numberProtoFuncToExponential):
328 (KJS::numberProtoFuncToPrecision):
329 (KJS::NumberObjectImp::NumberObjectImp):
330 (KJS::NumberObjectImp::getValueProperty):
331 (KJS::NumberObjectImp::construct):
332 (KJS::NumberObjectImp::callAsFunction):
334 (KJS::JSObject::call):
335 (KJS::JSObject::get):
336 (KJS::JSObject::put):
337 (KJS::JSObject::defineGetter):
338 (KJS::JSObject::defineSetter):
339 (KJS::JSObject::putDirect):
340 (KJS::Error::create):
342 * kjs/object_object.cpp:
343 (KJS::ObjectPrototype::ObjectPrototype):
344 (KJS::objectProtoFuncToLocaleString):
345 (KJS::objectProtoFuncToString):
346 (KJS::ObjectObjectImp::ObjectObjectImp):
347 (KJS::ObjectObjectImp::construct):
348 * kjs/property_map.h:
349 (KJS::SavedProperty::SavedProperty):
350 (KJS::SavedProperty::init):
351 (KJS::SavedProperty::~SavedProperty):
352 (KJS::SavedProperty::name):
353 (KJS::SavedProperty::value):
354 (KJS::SavedProperty::attributes):
358 * kjs/regexp_object.cpp:
359 (KJS::RegExpPrototype::RegExpPrototype):
360 (KJS::regExpProtoFuncToString):
361 (KJS::RegExpImp::getValueProperty):
362 (KJS::RegExpObjectImp::RegExpObjectImp):
363 (KJS::RegExpObjectImp::arrayOfMatches):
364 (KJS::RegExpObjectImp::getBackref):
365 (KJS::RegExpObjectImp::getLastParen):
366 (KJS::RegExpObjectImp::getLeftContext):
367 (KJS::RegExpObjectImp::getRightContext):
368 (KJS::RegExpObjectImp::getValueProperty):
369 (KJS::RegExpObjectImp::createRegExpImp):
370 * kjs/regexp_object.h:
371 * kjs/string_object.cpp:
372 (KJS::StringInstance::StringInstance):
373 (KJS::StringInstance::lengthGetter):
374 (KJS::StringInstance::indexGetter):
375 (KJS::stringInstanceNumericPropertyGetter):
376 (KJS::StringPrototype::StringPrototype):
378 (KJS::stringProtoFuncCharAt):
379 (KJS::stringProtoFuncCharCodeAt):
380 (KJS::stringProtoFuncConcat):
381 (KJS::stringProtoFuncIndexOf):
382 (KJS::stringProtoFuncLastIndexOf):
383 (KJS::stringProtoFuncMatch):
384 (KJS::stringProtoFuncSearch):
385 (KJS::stringProtoFuncReplace):
386 (KJS::stringProtoFuncSlice):
387 (KJS::stringProtoFuncSplit):
388 (KJS::stringProtoFuncSubstr):
389 (KJS::stringProtoFuncSubstring):
390 (KJS::stringProtoFuncToLowerCase):
391 (KJS::stringProtoFuncToUpperCase):
392 (KJS::stringProtoFuncToLocaleLowerCase):
393 (KJS::stringProtoFuncToLocaleUpperCase):
394 (KJS::stringProtoFuncLocaleCompare):
395 (KJS::stringProtoFuncBig):
396 (KJS::stringProtoFuncSmall):
397 (KJS::stringProtoFuncBlink):
398 (KJS::stringProtoFuncBold):
399 (KJS::stringProtoFuncFixed):
400 (KJS::stringProtoFuncItalics):
401 (KJS::stringProtoFuncStrike):
402 (KJS::stringProtoFuncSub):
403 (KJS::stringProtoFuncSup):
404 (KJS::stringProtoFuncFontcolor):
405 (KJS::stringProtoFuncFontsize):
406 (KJS::stringProtoFuncAnchor):
407 (KJS::stringProtoFuncLink):
408 (KJS::StringObjectImp::StringObjectImp):
409 (KJS::StringObjectImp::construct):
410 (KJS::StringObjectImp::callAsFunction):
411 (KJS::StringObjectFuncImp::StringObjectFuncImp):
412 (KJS::StringObjectFuncImp::callAsFunction):
413 * kjs/string_object.h:
414 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
416 (GlobalObject::GlobalObject):
423 (KJS::JSCell::operator new):
425 (KJS::jsOwnedString):
430 (KJS::jsNumberFromAnd):
431 (KJS::JSCell::marked):
433 (KJS::JSValue::toJSNumber):
434 * wtf/ThreadSpecific.h:
437 2008-05-10 Julien Chaffraix <jchaffraix@webkit.org>
441 * JavaScriptCore.pri: Add profiler/Profile.cpp.
442 * JavaScriptCoreSources.bkl: Ditto.
444 2008-05-10 Jan Michael Alonzo <jmalonzo@unpluggable.com>
450 * GNUmakefile.am: Add Profile.cpp in _sources
452 2008-05-09 Brady Eidson <beidson@apple.com>
454 Build Fix. Kevin is an idiot.
455 ("My name is Kevin McCullough and I approve this message.")
457 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
459 2008-05-09 Kevin McCullough <kmccullough@apple.com>
463 -<rdar://problem/5770054> JavaScript profiler (10928)
464 -Add Profile class so that all profiles can be stored and retrieved by
465 the WebInspector when that time comes.
467 * JavaScriptCore.exp: Export the new function signatures.
468 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the
470 * profiler/Profile.cpp: Added. This class represents a single run of the
472 (KJS::Profile::Profile):
473 (KJS::Profile::willExecute):
474 (KJS::Profile::didExecute):
475 (KJS::Profile::printDataInspectorStyle):
476 (KJS::functionNameCountPairComparator):
477 (KJS::Profile::printDataSampleStyle):
478 * profiler/Profile.h: Added. Ditto
479 (KJS::Profile::stopProfiling):
480 * profiler/Profiler.cpp: Now the profiler keeps track of many profiles
481 but only runs one at a time.
482 (KJS::Profiler::startProfiling):
483 (KJS::Profiler::stopProfiling):
484 (KJS::Profiler::willExecute):
485 (KJS::Profiler::didExecute):
486 (KJS::Profiler::printDataInspectorStyle):
487 (KJS::Profiler::printDataSampleStyle):
488 * profiler/Profiler.h: Ditto.
489 (KJS::Profiler::~Profiler):
490 (KJS::Profiler::allProfiles):
491 (KJS::Profiler::clearProfiles):
493 2008-05-08 Anders Carlsson <andersca@apple.com>
497 Enable NPAPI plug-ins on 64-bit.
501 2008-05-07 Julien Chaffraix <jchaffraix@webkit.org>
503 Reviewed by Adam Roben.
507 Add SIZE_MAX definition for the wx port.
511 2008-05-07 Ariya Hidayat <ariya.hidayat@trolltech.com>
515 Support for isMainThread in the Qt port.
517 * wtf/ThreadingQt.cpp:
518 (WTF::initializeThreading): Adjusted.
519 (WTF::isMainThread): Added.
521 2008-05-05 Darin Adler <darin@apple.com>
523 Reviewed by John Sullivan.
525 - fix debug-only leak seen on buildbot
528 (WTF::HashTable::checkKey): After writing an empty value in, but before constructing a
529 deleted value on top of it, call the destructor so the empty value doesn't leak.
531 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
533 Reviewed by Geoffrey Garen.
535 Get rid of static data in nodes.cpp (well, at least of non-debug one).
537 No measurable change on SunSpider.
539 * kjs/InitializeThreading.cpp:
540 (KJS::initializeThreadingOnce):
542 (KJS::newTrackedObjects):
543 (KJS::trackedObjectExtraRefCounts):
544 (KJS::initializeNodesThreading):
545 (KJS::ParserRefCounted::ParserRefCounted):
546 (KJS::ParserRefCounted::ref):
547 (KJS::ParserRefCounted::deref):
548 (KJS::ParserRefCounted::refcount):
549 (KJS::ParserRefCounted::deleteNewObjects):
551 Made newTrackedObjects and trackedObjectExtraRefCounts per-thread.
553 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
557 Move call stack depth counter to global object.
559 * kjs/ExecState.h: (KJS::ExecState::functionCallDepth): Added a recursion depth counter to
561 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Initialize PerThreadData.functionCallDepth.
562 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::perThreadData): Made the result non-const.
565 (KJS::throwStackSizeExceededError): Moved throwError to a separate function, since it is now
566 the only thing in JSObject::call that needs a PIC branch.
567 (KJS::JSObject::call): Use a per-thread variable instead of local static for recursion depth
570 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
574 Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
575 for the sake of non-WebKit clients.
579 * API/JSContextRef.cpp:
580 (JSGlobalContextCreate):
581 These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
582 and JSClassRef functions that can be called earlier, but they do not do anything that
583 requires initializeThreading.
585 * kjs/InitializeThreading.cpp:
586 (KJS::doInitializeThreading):
587 (KJS::initializeThreading):
588 On Darwin, make the initialization happen under pthread_once, since there is no guarantee
589 that non-WebKit clients won't try to call this function re-entrantly.
591 * kjs/InitializeThreading.h:
593 Spell out initializeThreading contract.
595 * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
596 Darwin, even if threading was initialized from a secondary thread.
598 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
600 Reviewed by Geoffrey Garen.
602 https://bugs.webkit.org/show_bug.cgi?id=18826
603 Make JavaScript heap per-thread
605 * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
606 (replaced "new T" with "new T()").
608 * kjs/collector.h: Renamed Collector to Heap, made the heap per-thread. Removed support for
609 multithreaded access to a heap.
610 (KJS::CollectorBlock): Removed collectOnMainThreadOnly bitmap, added a reference to owner heap.
611 (KJS::SmallCellCollectorBlock): Ditto.
612 (KJS::Heap::markListSet): Moved from a static variable in List.cpp to a per-thread one here.
613 (KJS::Heap::heap): Added a method to find which heap a JSValue is allocated in.
615 * kjs/collector.cpp: Changed "const size_t" constants to #defines, to avoid a PIC branch
616 (gcc was using one to access a constant used in std::max(), because it takes a reference,
617 even though std::max() itself was inlined).
618 (KJS::Heap::threadHeap): JS heap is now per-thread.
619 (KJS::Heap::Heap): Zero-initialize the heap.
620 (KJS::allocateBlock): Added NEVER_INLINE, because this function uses a PIC branch, so
621 inlining it in Heap::heapAllocate() is bad for performance, now that the latter doesn't
623 (KJS::Heap::heapAllocate): Initialize Block::heap.
624 (KJS::Heap::markCurrentThreadConservatively): Moved into markStackObjectsConservatively(),
625 as GC only works with a current thread's heap now.
626 (KJS::Heap::sweep): Removed collectOnMainThreadOnly checks.
627 (KJS::Heap::collect): Ditto.
631 (KJS::JSLock::JSLock):
632 Removed registerThread(), as the heap no longer cares.
634 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize new per-thread
635 variables in Heap and JSGlobalObject.
637 * kjs/ExecState.h: (KJS::ExecState::heap): Added a heap pointer for faster access to
638 per-thread heap, and an accessor for it.
640 * kjs/JSGlobalObject.h: Made JSGlobalObject linked list per-thread.
641 * kjs/JSGlobalObject.cpp:
642 (KJS::JSGlobalObject::~JSGlobalObject): Fixed a bug in linked list handling. It only worked
643 right if the removed object was the head one!
644 (KJS::JSGlobalObject::head): Return a per-thread list head.
645 (KJS::JSGlobalObject::init): Store a reference to per-thread heap.
646 (KJS::JSGlobalObject::reset): Pass ExecState to functions that need it.
647 (KJS::JSGlobalObject::tearOffActivation): Ditto.
648 (KJS::JSGlobalObject::operator new): JSGlobalObject allocation cannot use an ExecState,
649 so it needs a custom operator new that directly accesses per-thread heap.
652 (KJS::List::List): Replaced m_isInMarkSet boolean with an actual pointer to the set, since it
653 is no longer a single static object.
654 (KJS::List::~List): Ditto.
656 (KJS::List::markSet): Removed, this is now stored in Heap.
657 (KJS::List::markProtectedLists): Take a reference to the list.
658 (KJS::List::expandAndAppend): Ask the current thread heap for a mark set reference.
663 Use the newly added Heap::heap() method to find out which heap the value to be (un)protected
666 * kjs/property_map.h: Removed unused SavedProperty class.
668 * JavaScriptCore.exp:
671 * API/JSCallbackObjectFunctions.h:
672 (KJS::::staticFunctionGetter):
673 * API/JSClassRef.cpp:
674 (OpaqueJSClass::prototype):
675 * API/JSObjectRef.cpp:
677 (JSObjectMakeFunctionWithCallback):
678 (JSObjectMakeConstructor):
679 (JSObjectMakeFunction):
680 * API/JSValueRef.cpp:
683 * kjs/array_instance.cpp:
684 (KJS::ArrayInstance::ArrayInstance):
685 (KJS::ArrayInstance::lengthGetter):
686 * kjs/array_object.cpp:
687 (KJS::arrayProtoFuncToString):
688 (KJS::arrayProtoFuncToLocaleString):
689 (KJS::arrayProtoFuncJoin):
690 (KJS::arrayProtoFuncConcat):
691 (KJS::arrayProtoFuncPop):
692 (KJS::arrayProtoFuncPush):
693 (KJS::arrayProtoFuncShift):
694 (KJS::arrayProtoFuncSlice):
695 (KJS::arrayProtoFuncSplice):
696 (KJS::arrayProtoFuncUnShift):
697 (KJS::arrayProtoFuncFilter):
698 (KJS::arrayProtoFuncMap):
699 (KJS::arrayProtoFuncEvery):
700 (KJS::arrayProtoFuncForEach):
701 (KJS::arrayProtoFuncSome):
702 (KJS::arrayProtoFuncIndexOf):
703 (KJS::arrayProtoFuncLastIndexOf):
704 (KJS::ArrayObjectImp::ArrayObjectImp):
705 (KJS::ArrayObjectImp::construct):
706 * kjs/bool_object.cpp:
707 (KJS::BooleanPrototype::BooleanPrototype):
708 (KJS::booleanProtoFuncToString):
709 (KJS::BooleanObjectImp::BooleanObjectImp):
710 (KJS::BooleanObjectImp::construct):
711 * kjs/date_object.cpp:
712 (KJS::formatLocaleDate):
713 (KJS::DatePrototype::DatePrototype):
714 (KJS::DateObjectImp::DateObjectImp):
715 (KJS::DateObjectImp::construct):
716 (KJS::DateObjectImp::callAsFunction):
717 (KJS::DateObjectFuncImp::DateObjectFuncImp):
718 (KJS::DateObjectFuncImp::callAsFunction):
719 (KJS::dateProtoFuncToString):
720 (KJS::dateProtoFuncToUTCString):
721 (KJS::dateProtoFuncToDateString):
722 (KJS::dateProtoFuncToTimeString):
723 (KJS::dateProtoFuncToLocaleString):
724 (KJS::dateProtoFuncToLocaleDateString):
725 (KJS::dateProtoFuncToLocaleTimeString):
726 (KJS::dateProtoFuncValueOf):
727 (KJS::dateProtoFuncGetTime):
728 (KJS::dateProtoFuncGetFullYear):
729 (KJS::dateProtoFuncGetUTCFullYear):
730 (KJS::dateProtoFuncToGMTString):
731 (KJS::dateProtoFuncGetMonth):
732 (KJS::dateProtoFuncGetUTCMonth):
733 (KJS::dateProtoFuncGetDate):
734 (KJS::dateProtoFuncGetUTCDate):
735 (KJS::dateProtoFuncGetDay):
736 (KJS::dateProtoFuncGetUTCDay):
737 (KJS::dateProtoFuncGetHours):
738 (KJS::dateProtoFuncGetUTCHours):
739 (KJS::dateProtoFuncGetMinutes):
740 (KJS::dateProtoFuncGetUTCMinutes):
741 (KJS::dateProtoFuncGetSeconds):
742 (KJS::dateProtoFuncGetUTCSeconds):
743 (KJS::dateProtoFuncGetMilliSeconds):
744 (KJS::dateProtoFuncGetUTCMilliseconds):
745 (KJS::dateProtoFuncGetTimezoneOffset):
746 (KJS::dateProtoFuncSetTime):
747 (KJS::setNewValueFromTimeArgs):
748 (KJS::setNewValueFromDateArgs):
749 (KJS::dateProtoFuncSetYear):
750 (KJS::dateProtoFuncGetYear):
751 * kjs/error_object.cpp:
752 (KJS::ErrorPrototype::ErrorPrototype):
753 (KJS::errorProtoFuncToString):
754 (KJS::ErrorObjectImp::ErrorObjectImp):
755 (KJS::ErrorObjectImp::construct):
756 (KJS::NativeErrorPrototype::NativeErrorPrototype):
757 (KJS::NativeErrorImp::NativeErrorImp):
758 (KJS::NativeErrorImp::construct):
760 (KJS::FunctionImp::lengthGetter):
761 (KJS::FunctionImp::construct):
762 (KJS::Arguments::Arguments):
763 (KJS::ActivationImp::createArgumentsObject):
766 (KJS::globalFuncParseInt):
767 (KJS::globalFuncParseFloat):
768 (KJS::globalFuncEscape):
769 (KJS::globalFuncUnescape):
770 (KJS::PrototypeFunction::PrototypeFunction):
771 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
772 * kjs/function_object.cpp:
773 (KJS::FunctionPrototype::FunctionPrototype):
774 (KJS::functionProtoFuncToString):
775 (KJS::FunctionObjectImp::FunctionObjectImp):
776 (KJS::FunctionObjectImp::construct):
778 (KJS::StringImp::toObject):
780 (KJS::StringImp::StringImp):
781 (KJS::NumberImp::operator new):
783 (KJS::staticFunctionGetter):
784 (KJS::cacheGlobalObject):
785 * kjs/math_object.cpp:
786 (KJS::MathObjectImp::getValueProperty):
787 (KJS::mathProtoFuncAbs):
788 (KJS::mathProtoFuncACos):
789 (KJS::mathProtoFuncASin):
790 (KJS::mathProtoFuncATan):
791 (KJS::mathProtoFuncATan2):
792 (KJS::mathProtoFuncCeil):
793 (KJS::mathProtoFuncCos):
794 (KJS::mathProtoFuncExp):
795 (KJS::mathProtoFuncFloor):
796 (KJS::mathProtoFuncLog):
797 (KJS::mathProtoFuncMax):
798 (KJS::mathProtoFuncMin):
799 (KJS::mathProtoFuncPow):
800 (KJS::mathProtoFuncRandom):
801 (KJS::mathProtoFuncRound):
802 (KJS::mathProtoFuncSin):
803 (KJS::mathProtoFuncSqrt):
804 (KJS::mathProtoFuncTan):
806 (KJS::Node::handleException):
807 (KJS::NumberNode::evaluate):
808 (KJS::StringNode::evaluate):
809 (KJS::ArrayNode::evaluate):
810 (KJS::PostIncResolveNode::evaluate):
811 (KJS::PostIncLocalVarNode::evaluate):
812 (KJS::PostDecResolveNode::evaluate):
813 (KJS::PostDecLocalVarNode::evaluate):
814 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
815 (KJS::PostIncBracketNode::evaluate):
816 (KJS::PostDecBracketNode::evaluate):
817 (KJS::PostIncDotNode::evaluate):
818 (KJS::PostDecDotNode::evaluate):
819 (KJS::typeStringForValue):
820 (KJS::LocalVarTypeOfNode::evaluate):
821 (KJS::TypeOfResolveNode::evaluate):
822 (KJS::TypeOfValueNode::evaluate):
823 (KJS::PreIncLocalVarNode::evaluate):
824 (KJS::PreIncResolveNode::evaluate):
825 (KJS::PreDecLocalVarNode::evaluate):
826 (KJS::PreDecResolveNode::evaluate):
827 (KJS::PreIncConstNode::evaluate):
828 (KJS::PreDecConstNode::evaluate):
829 (KJS::PostIncConstNode::evaluate):
830 (KJS::PostDecConstNode::evaluate):
831 (KJS::PreIncBracketNode::evaluate):
832 (KJS::PreDecBracketNode::evaluate):
833 (KJS::PreIncDotNode::evaluate):
834 (KJS::PreDecDotNode::evaluate):
835 (KJS::NegateNode::evaluate):
836 (KJS::BitwiseNotNode::evaluate):
837 (KJS::MultNode::evaluate):
838 (KJS::DivNode::evaluate):
839 (KJS::ModNode::evaluate):
842 (KJS::AddNumbersNode::evaluate):
843 (KJS::AddStringsNode::evaluate):
844 (KJS::AddStringLeftNode::evaluate):
845 (KJS::AddStringRightNode::evaluate):
846 (KJS::SubNode::evaluate):
847 (KJS::LeftShiftNode::evaluate):
848 (KJS::RightShiftNode::evaluate):
849 (KJS::UnsignedRightShiftNode::evaluate):
850 (KJS::BitXOrNode::evaluate):
851 (KJS::BitOrNode::evaluate):
852 (KJS::valueForReadModifyAssignment):
853 (KJS::ForInNode::execute):
854 (KJS::TryNode::execute):
855 (KJS::FuncDeclNode::makeFunction):
856 (KJS::FuncExprNode::evaluate):
857 * kjs/number_object.cpp:
858 (KJS::NumberPrototype::NumberPrototype):
859 (KJS::numberProtoFuncToString):
860 (KJS::numberProtoFuncToLocaleString):
861 (KJS::numberProtoFuncToFixed):
862 (KJS::numberProtoFuncToExponential):
863 (KJS::numberProtoFuncToPrecision):
864 (KJS::NumberObjectImp::NumberObjectImp):
865 (KJS::NumberObjectImp::getValueProperty):
866 (KJS::NumberObjectImp::construct):
867 (KJS::NumberObjectImp::callAsFunction):
869 (KJS::JSObject::defineGetter):
870 (KJS::JSObject::defineSetter):
871 (KJS::JSObject::putDirect):
872 (KJS::Error::create):
874 * kjs/object_object.cpp:
875 (KJS::ObjectPrototype::ObjectPrototype):
876 (KJS::objectProtoFuncToLocaleString):
877 (KJS::objectProtoFuncToString):
878 (KJS::ObjectObjectImp::ObjectObjectImp):
879 (KJS::ObjectObjectImp::construct):
880 * kjs/regexp_object.cpp:
881 (KJS::RegExpPrototype::RegExpPrototype):
882 (KJS::regExpProtoFuncToString):
883 (KJS::RegExpImp::getValueProperty):
884 (KJS::RegExpObjectImp::RegExpObjectImp):
885 (KJS::RegExpObjectImp::arrayOfMatches):
886 (KJS::RegExpObjectImp::getBackref):
887 (KJS::RegExpObjectImp::getLastParen):
888 (KJS::RegExpObjectImp::getLeftContext):
889 (KJS::RegExpObjectImp::getRightContext):
890 (KJS::RegExpObjectImp::getValueProperty):
891 (KJS::RegExpObjectImp::createRegExpImp):
892 * kjs/regexp_object.h:
893 * kjs/string_object.cpp:
894 (KJS::StringInstance::StringInstance):
895 (KJS::StringInstance::lengthGetter):
896 (KJS::StringInstance::indexGetter):
897 (KJS::stringInstanceNumericPropertyGetter):
898 (KJS::StringPrototype::StringPrototype):
900 (KJS::stringProtoFuncCharAt):
901 (KJS::stringProtoFuncCharCodeAt):
902 (KJS::stringProtoFuncConcat):
903 (KJS::stringProtoFuncIndexOf):
904 (KJS::stringProtoFuncLastIndexOf):
905 (KJS::stringProtoFuncMatch):
906 (KJS::stringProtoFuncSearch):
907 (KJS::stringProtoFuncReplace):
908 (KJS::stringProtoFuncSlice):
909 (KJS::stringProtoFuncSplit):
910 (KJS::stringProtoFuncSubstr):
911 (KJS::stringProtoFuncSubstring):
912 (KJS::stringProtoFuncToLowerCase):
913 (KJS::stringProtoFuncToUpperCase):
914 (KJS::stringProtoFuncToLocaleLowerCase):
915 (KJS::stringProtoFuncToLocaleUpperCase):
916 (KJS::stringProtoFuncLocaleCompare):
917 (KJS::stringProtoFuncBig):
918 (KJS::stringProtoFuncSmall):
919 (KJS::stringProtoFuncBlink):
920 (KJS::stringProtoFuncBold):
921 (KJS::stringProtoFuncFixed):
922 (KJS::stringProtoFuncItalics):
923 (KJS::stringProtoFuncStrike):
924 (KJS::stringProtoFuncSub):
925 (KJS::stringProtoFuncSup):
926 (KJS::stringProtoFuncFontcolor):
927 (KJS::stringProtoFuncFontsize):
928 (KJS::stringProtoFuncAnchor):
929 (KJS::stringProtoFuncLink):
930 (KJS::StringObjectImp::StringObjectImp):
931 (KJS::StringObjectImp::construct):
932 (KJS::StringObjectImp::callAsFunction):
933 (KJS::StringObjectFuncImp::StringObjectFuncImp):
934 (KJS::StringObjectFuncImp::callAsFunction):
935 * kjs/string_object.h:
936 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
938 (GlobalObject::GlobalObject):
945 (KJS::JSCell::operator new):
947 (KJS::jsOwnedString):
952 (KJS::jsNumberFromAnd):
953 (KJS::JSCell::marked):
955 (KJS::JSValue::toJSNumber):
956 Removed collectOnMainThreadOnly, as this is the only way to collect now. Replaced calls to
957 static Collector methods with calls to per-thread Heap ones.
959 2008-05-02 Dan Bernstein <mitz@apple.com>
961 Reviewed by Maciej Stachowiak.
965 * wtf/StrHash.h: Added header guards and removed #include "config.h".
967 2008-05-01 Ada Chan <adachan@apple.com>
969 #include <wtf/StrHash.h> in identifier.cpp.
973 * kjs/identifier.cpp:
975 2008-05-01 Steve Falkenburg <sfalken@apple.com>
979 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
981 2008-05-01 Sam Weinig <sam@webkit.org>
985 * JavaScriptCore.xcodeproj/project.pbxproj:
987 2008-05-01 Kevin McCullough <kmccullough@apple.com>
991 <rdar://problem/5770054> JavaScript profiler (10928)
992 - Fix "sample" output so that it can be imported into Instruments
993 - Also keep track of number of times a function is profiled.
995 * JavaScriptCore.xcodeproj/project.pbxproj: Add StrHash.h which needed
996 to be pulled out of identifier.cpp so that it could be used by the
997 profiler and identifiers.
998 * kjs/identifier.cpp: Ditto.
999 * profiler/FunctionCallProfile.cpp:
1000 (KJS::FunctionCallProfile::printDataInspectorStyle): Inspector style
1001 printing should show microseconds.
1002 (KJS::FunctionCallProfile::printDataSampleStyle): Sample style printing
1003 now counts the number of times a function is in the stack tree and does
1004 not print microseconds since that does not make sense for a sampler.
1005 * profiler/FunctionCallProfile.h: Keep track of number of times a
1006 function is profiled.
1007 (KJS::FunctionCallProfile::numberOfCalls):
1008 * profiler/Profiler.cpp:
1009 (KJS::functionNameCountPairComparator): Comparator for sort function in
1010 printDataSampleStyle.
1011 (KJS::Profiler::printDataSampleStyle): Print the number of times that a
1012 function is listed in the stack tree in order of most times listed.
1013 * wtf/HashCountedSet.h: Added copyToVector since it didn't exist and is
1014 a more standard way to copy a HashSet to a Vector. I added on variant
1015 that takes a pair as the Vector's type and so the HashCountedSet simply
1016 fills in that pair with its internal pair, and another variant that
1017 takes a Vector of the type of the HashCountedSet and only fills in the
1018 Vector with the first element of the pair.
1019 (WTF::copyToVector):
1020 * wtf/StrHash.h: Added.
1023 2008-04-29 David Kilzer <ddkilzer@apple.com>
1025 BUILD FIX for ENABLE(DASHBOARD_SUPPORT)
1027 * wtf/Platform.h: Defined ENABLE(DASHBOARD_SUPPORT) to 1 only for
1028 PLATFORM(MAC) and PLATFORM(WIN). Changed default to 0 for other
1031 2008-04-29 Greg Bolsinga <bolsinga@apple.com>
1035 Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
1039 2008-04-29 Kevin McCullough <kmccullough@apple.com>
1043 -<rdar://problem/5770054> JavaScript profiler (10928)
1046 * profiler/FunctionCallProfile.cpp:
1047 (KJS::FunctionCallProfile::FunctionCallProfile):
1048 (KJS::FunctionCallProfile::didExecute): Implements call count and fixed a bug where a stackIndex
1049 of 0 was causing the assert to be hit.
1050 (KJS::FunctionCallProfile::stopProfiling):
1051 (KJS::FunctionCallProfile::endAndRecordCall):
1052 * profiler/FunctionCallProfile.h:
1054 2008-04-29 Simon Hausmann <hausmann@webkit.org>
1056 Qt/Windows build fix. The externally declared hash tables are actually
1057 declared const and the const is mangled in the symbol name, so when
1058 importing they also need to be marked const.
1060 When compiling without MULTIPLE_THREADS use a const HashTable&
1061 instead of a HashTable& in ThreadClassInfoHashTables to avoid
1062 initializing the latter with a const reference.
1064 * kjs/JSGlobalObject.cpp:
1066 2008-04-28 Alexey Proskuryakov <ap@webkit.org>
1070 * kjs/ExecState.h: For whatever reason, MSVC couldn't generate a default constructor for
1071 a struct that had a "const List" member. Removing the const qulifier makes the problem go away.
1073 2008-04-28 Alexey Proskuryakov <ap@webkit.org>
1077 Fix run-webkit-tests --threading
1078 and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
1079 Proxy server issue in Sunday's Nightly
1081 Changed ClassInfo objects for built-in objects to hold a getter function returning
1082 a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
1083 and these are the only ones that need to be shared.
1086 (KJS::Lexer::Lexer):
1087 (KJS::Lexer::~Lexer):
1089 Made mainTable a member of Lexer, so that it no longer needs to be shared between threads.
1092 (KJS::JSObject::deleteProperty):
1093 (KJS::JSObject::findPropertyHashEntry):
1094 (KJS::JSObject::propertyIsEnumerable):
1095 (KJS::JSObject::getPropertyAttributes):
1096 (KJS::JSObject::getPropertyNames):
1098 (KJS::ClassInfo::propHashTable):
1099 Added a new classPropHashTableGetterFunction field to ClassInfo. If it is non-zero, the
1100 static table is not used.
1102 * kjs/JSGlobalObject.cpp:
1103 (KJS::ThreadClassInfoHashTables::ThreadClassInfoHashTables): This new class holds per-thread
1104 HashTables for built-in classes. The old static structs are copied to create per-thread
1106 (KJS::JSGlobalObject::threadClassInfoHashTables): An accessor/initializer for the above.
1107 (KJS::JSGlobalObject::init): Copy per-thread data into a single structure for faster access.
1108 Also, construct globalExec.
1109 (KJS::JSGlobalObject::reset): Adapted for globalExec now being an OwnPtr.
1110 (KJS::JSGlobalObject::mark): Ditto.
1111 (KJS::JSGlobalObject::globalExec): Ditto.
1112 * kjs/JSGlobalObject.h:
1113 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Made JSGlobalObject::JSGlobalObjectData::globalExec an OwnPtr, so that it can
1114 be initialized from JSGlobalObject::init() after them. Otherwise, ExecState constructor was
1115 trying to access half-initialized JSGlobalObject to make its own copy of these table
1116 references, and failed.
1117 (KJS::JSGlobalObject::JSGlobalObject): Pass "this" value to init() to create globalExec.
1118 (KJS::JSGlobalObject::perThreadData): An accessor for per-thread data.
1120 * kjs/ExecState.cpp:
1121 (KJS::ExecState::ExecState):
1123 (KJS::ExecState::propertyNames):
1124 (KJS::ExecState::emptyList):
1125 (KJS::ExecState::arrayTable):
1126 (KJS::ExecState::dateTable):
1127 (KJS::ExecState::mathTable):
1128 (KJS::ExecState::numberTable):
1129 (KJS::ExecState::RegExpImpTable):
1130 (KJS::ExecState::RegExpObjectImpTable):
1131 (KJS::ExecState::stringTable):
1132 * kjs/ExecStateInlines.h:
1133 (KJS::ExecState::ExecState):
1134 Each ExecState holds its own reference to per-thread data, for even faster access. Moved
1135 m_emptyList and m_propertyNames to the same structure, making ExecState faster to construct
1136 and take less space on the stack.
1138 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Initialize thread-static data
1139 added to JSGlobalObject.
1141 * API/JSCallbackConstructor.cpp:
1143 * API/JSCallbackFunction.cpp:
1145 * API/JSCallbackObject.cpp:
1147 * JavaScriptCore.exp:
1148 * kjs/JSVariableObject.cpp:
1149 (KJS::JSVariableObject::getPropertyAttributes):
1150 * kjs/JSVariableObject.h:
1151 * kjs/array_instance.cpp:
1153 * kjs/array_object.cpp:
1155 (KJS::ArrayPrototype::getOwnPropertySlot):
1156 * kjs/bool_object.cpp:
1158 * kjs/create_hash_table:
1159 * kjs/date_object.cpp:
1161 (KJS::DatePrototype::getOwnPropertySlot):
1162 (KJS::DateObjectImp::DateObjectImp):
1163 * kjs/error_object.cpp:
1167 * kjs/function_object.cpp:
1168 (KJS::FunctionPrototype::FunctionPrototype):
1172 * kjs/math_object.cpp:
1174 (KJS::MathObjectImp::getOwnPropertySlot):
1175 * kjs/number_object.cpp:
1177 (KJS::NumberObjectImp::getOwnPropertySlot):
1178 * kjs/object_object.cpp:
1179 (KJS::ObjectPrototype::ObjectPrototype):
1180 * kjs/regexp_object.cpp:
1182 (KJS::RegExpPrototype::RegExpPrototype):
1183 (KJS::RegExpImp::getOwnPropertySlot):
1184 (KJS::RegExpImp::put):
1185 (KJS::RegExpObjectImp::getOwnPropertySlot):
1186 (KJS::RegExpObjectImp::put):
1187 * kjs/string_object.cpp:
1189 (KJS::StringPrototype::getOwnPropertySlot):
1190 Adjust for the above changes.
1192 2008-04-28 Darin Adler <darin@apple.com>
1196 - make sure RefPtr's default hash doesn't ref/deref when computing the hash
1197 - remove remnants of the hash table storage type optimization
1199 * wtf/HashFunctions.h: Used "using" to get the hash and equal functions
1200 from PtrHash<P*> into PtrHash<RefPtr<P>>.
1202 * wtf/HashMap.h: Replaced uses of PairBaseHashTraits with PairHashTraits.
1203 Eliminated storage-related typedefs. Removed constructor, destructor,
1204 copy constructor, and destructor since the compiler-generated ones are
1205 fine. Removed refAll and derefAll. Took out unnnecessary typecasts.
1206 Removed use of RefCounter.
1208 * wtf/HashSet.h: Eliminated storage-related typedefs. Removed constructor,
1209 destructor, copy constructor, and destructor since the compiler-generated
1210 ones are fine. Removed refAll and derefAll. Removed unneeded template
1211 arguents from HashSetTranslatorAdapter. Eliminated unneeded HashSetTranslator
1214 * wtf/HashTable.h: Tweaked formatting. Removed NeedsRef, RefCounterBase,
1215 RefCounter, HashTableRefCounterBase, HashTableRefCounter, and Assigner
1218 * wtf/HashTraits.h: Removed StorageTraits, needsRef, PairBaseHashTraits,
1219 and HashKeyStorageTraits.
1221 * wtf/RefPtrHashMap.h: Made all the same fixes as in HashMap. Also made
1222 the corresponding changes to RefPtrHashMapRawKeyTranslator.
1224 2008-04-28 Darin Adler <darin@apple.com>
1228 - fix assertion hit every time you view www.apple.com
1230 * kjs/PropertyNameArray.cpp:
1231 (KJS::PropertyNameArray::add): Changed assertion to allow null and empty strings.
1232 Now to find out why we have a property named "" and if that's a bug!
1234 2008-04-27 Mark Rowe <mrowe@apple.com>
1236 Reviewed by Maciej Stachowiak.
1238 Fix crash inside PtrHash::hash when loading a page.
1240 * wtf/HashFunctions.h: Explicitly use the superclass implementation of hash to avoid infinite recursion.
1242 2008-04-27 Darin Adler <darin@apple.com>
1246 - fix <rdar://problem/5657459> REGRESSION: JavaScriptCore no longer builds with
1247 GCC 4.2 due to pointer aliasing warnings
1249 Fix this by removing the HashTable optimizations that allowed us to share a back end
1250 implementation between hash tables with integers, pointers, RefPtr, and String objects
1251 as keys. The way it worked was incompatible with strict aliasing.
1253 This increases code size. On Mac OS X we'll have to regenerate .order files to avoid
1254 slowing down Safari startup times.
1256 This creates a slight slowdown in SunSpider, mitigated by the following four speedups:
1258 - speed up array put slightly by moving a branch (was already done for get)
1260 - speed up symbol table access by adding a function named inlineGet to HashMap
1261 and using that in symbolTableGet/Put
1263 - speed up PropertyNameArray creation by reducing the amount of reference count
1264 churn and uniqueness checking when adding names and not doing any allocation at
1265 all when building small arrays
1267 - speed up conversion of strings to floating point numbers by eliminating the
1268 malloc/free of the buffer for the ASCII copy of the string; a way to make
1269 things even faster would be to change strtod to take a UTF-16 string
1271 Note that there is considerable unused complexity now in HashSet/Map/Table to support
1272 "storage types", which is no longer used. Will do in a separate patch.
1274 * API/JSCallbackObjectFunctions.h:
1275 (KJS::JSCallbackObject<Base>::getPropertyNames): Removed explicit cast to Identifier to
1276 take advantage of the new PropertyNameArray::add overload and avoid reference count churn.
1277 * API/JSObjectRef.cpp:
1278 (JSPropertyNameAccumulatorAddName): Ditto.
1279 * JavaScriptCore.exp: Updated PropertyNameArray::add entry point name.
1281 * kjs/JSVariableObject.cpp: Removed now-unneeded IdentifierRepHashTraits::nullRepPtr
1282 definition (see below).
1283 (KJS::JSVariableObject::getPropertyNames): Removed explicit cast to Identifier.
1285 * kjs/JSVariableObject.h:
1286 (KJS::JSVariableObject::symbolTableGet): Use inlineGet for speed. Also changed to do
1287 early exit instead of nesting the body inside an if.
1288 (KJS::JSVariableObject::symbolTablePut): Ditto.
1290 * kjs/PropertyNameArray.cpp:
1291 (KJS::PropertyNameArray::add): Changed implementation to take a raw pointer instead of
1292 a reference to an identifier. Do uniqueness checking by searching the vector when the
1293 vector is short, only building the set once the vector is large enough.
1295 * kjs/PropertyNameArray.h: Added an overload of add for a raw pointer, and made the old
1296 add function call that one. Added an addKnownUnique function for use when the new
1297 name is known to be different from any other in the array. Changed the vector to have
1298 an inline capacity of 20.
1300 * kjs/SymbolTable.h: Changed IdentifierRepHash to inherit from the default hash for
1301 a RefPtr so we don't have to define so much. Added an overload of the hash function for
1302 a raw pointer as required by the new RefPtrHashMap. Got rid of the now-unneeded
1303 IdentifierRepHashTraits -- the default traits now work fine. Added a definition of
1304 empthValueIsZero to SymbolTableIndexHashTraits; not having it was incorrect, but harmless.
1306 * kjs/array_instance.cpp:
1307 (KJS::ArrayInstance::put): Move the maxArrayIndex check inside the branch that checks
1308 the index against the length, as done in the get function.
1311 (KJS::globalFuncKJSPrint): Changed to use the new getCString instead of cstring.
1313 * kjs/internal.cpp: Removed printInfo debugging function, a client of cstring.
1314 If we need a debugging function we can easily make a better one and we haven't
1315 used this one in a long time.
1316 * kjs/internal.h: Ditto.
1319 (KJS::JSObject::getPropertyNames): Removed explicit cast to Identifier.
1320 * kjs/property_map.cpp:
1321 (KJS::PropertyMap::getEnumerablePropertyNames): Ditto. Also added a special case for
1322 the case where the propertyNames array is empty -- in that case we know we're adding
1323 a set of names that are non-overlapping so we can use addKnownUnique.
1325 (KJS::UString::getCString): Replaces cstring. Puts the C string into a CStringBuffer,
1326 which is a char Vector with an inline capacity. Also returns a boolean to indicate if
1327 the converion was lossy, which eliminates the need for a separate is8Bit call.
1328 (KJS::UString::toDouble): Changed to call getCString instead of cstring.
1329 * kjs/ustring.h: Ditto.
1331 * wtf/HashFunctions.h: Overload the hash and equal functions for RefPtr's default
1332 hash to take raw pointers. This works with the changes to RefPtrHashMap to avoid
1333 introducing refcount churn.
1335 * wtf/HashMap.h: Removed special code to convert the deleted value to the empty value
1336 when writing a new value into the map. This is now handled elsewhere.
1337 (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1338 HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1341 (WTF::HashTable::isDeletedBucket): Changed to use isDeletedValue instead of using
1342 deletedValue and the equality operator.
1343 (WTF::HashTable::deleteBucket): Changed to use constructDeletedValue instead of
1344 using deletedValue and the assignment operator.
1345 (WTF::HashTable::checkKey): Added. Factors out the check for values that are empty
1346 or deleted keys that's used in various functions below.
1347 (WTF::HashTable::lookup): Changed to use checkKey, check for a 0 table, and also
1348 made public for use by RefPtrHashMap.
1349 (WTF::HashTable::lookupForWriting): Changed to use checkKey.
1350 (WTF::HashTable::fullLookupForWriting): Changed to use checkKey.
1351 (WTF::HashTable::add): Changed to use checkKey, and call initializeBucket on a
1352 deleted bucket before putting a new entry into it.
1353 (WTF::HashTable::addPassingHashCode): Ditto.
1354 (WTF::HashTable::deallocateTable): Check isDeletedBucket before calling ~ValueType.
1356 * wtf/HashTraits.h: Got ridd of all the HashTraits specialization for the integer
1357 types, since GeneicHashTraitsBase already deals with integers separately. Put the
1358 deleted value support into GenericHashTraitsBase. Changed FloatHashTraits to
1359 inherit from GenericHashTraits, and define construct/isDeletedValue rather than
1360 deletedValue. Removed the ref and deref functions from RefPtr's HashTraits, and
1361 defined construct/isDeletedValue. Eliminated DeletedValueAssigner. Changed
1362 PairHashTraits to define construct/isDeletedValue, and also merged
1363 PairBaseHashTraits in with PairHashTraits. Got rid of all specialization of
1364 HashKeyStorageTraits. We'll remove that, and the needsRef data member, later.
1366 * wtf/RefPtr.h: Added HashTableDeletedValueType, an enum type with a single value,
1367 HashTableDeletedValue. Used that type to make a new constructor to construct
1368 deleted values and also added an isHashTableDeletedValue function.
1370 * wtf/RefPtrHashMap.h: Added RefPtrHashMapRawKeyTranslator and used it to implement
1371 the raw pointer functions. This is a way to continue to avoid refcount thrash. We
1372 can't use the old way because it depended on the underlying map using a non-RefPtr
1374 (WTF::HashMap::find): Use find with RefPtrHashMapRawKeyTranslator.
1375 (WTF::HashMap::contains): Use contains with RefPtrHashMapRawKeyTranslator.
1376 (WTF::HashMap::inlineAdd): Use add with RefPtrHashMapRawKeyTranslator.
1377 (WTF::HashMap::get): Removed code that checks for an empty hash table before calling
1378 HashTable::lookup; it's slightly more efficient to do this check inside lookup.
1379 (WTF::HashMap::inlineGet): Added. Just like get, but marked inline for use in the
1382 2008-04-25 Sam Weinig <sam@webkit.org>
1384 Rubber-stamped by Mark Rowe.
1386 Remove SavedBuiltins and SavedProperties classes and the methods used to
1387 save data to them. The CachedPage now stores a the JSGlobalObject in full.
1389 * JavaScriptCore.exp:
1390 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1391 * JavaScriptCore.xcodeproj/project.pbxproj:
1392 * kjs/JSGlobalObject.cpp:
1393 * kjs/JSGlobalObject.h:
1394 * kjs/JSVariableObject.cpp:
1395 * kjs/JSVariableObject.h:
1396 (KJS::JSVariableObject::localStorage):
1397 * kjs/SavedBuiltins.h: Removed.
1399 * kjs/property_map.cpp:
1400 * kjs/property_map.h:
1402 2008-04-25 Mark Rowe <mrowe@apple.com>
1404 Rubber-stamped by Sam Weinig.
1406 Add some content to an empty ICU header file to prevent verification errors.
1408 * icu/unicode/utf_old.h:
1410 2008-04-25 David Kilzer <ddkilzer@apple.com>
1412 <rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
1414 Patch by George Dicker and Michael Kahl. Reviewed by Darin.
1416 When -[NSObject(WebScriptDebugDelegate) webView:willLeaveCallFrame:sourceId:line:forWebFrame:]
1417 is invoked, the first line number of the function is returned instead of the last
1418 line number. This regressed in r28458.
1421 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
1422 when calling Debugger::returnEvent().
1424 2008-04-25 Darin Adler <darin@apple.com>
1426 Done with Stephanie Lewis.
1428 * JavaScriptCore.xcodeproj/project.pbxproj: Prepare for compilation with gcc 4.2 by
1429 adding -fno-strict-aliasing to CollatorICU.cpp.
1431 2008-04-24 Sam Weinig <sam@webkit.org>
1433 Reviewed by Geoffrey Garen.
1435 Add a #define to easily enable collecting on every allocation to aid
1438 * kjs/collector.cpp:
1439 (KJS::Collector::heapAllocate):
1441 2008-04-24 Kevin McCullough <kmccullough@apple.com>
1443 Reviewed by Adam and Sam.
1445 -<rdar://problem/5770054> JavaScript profiler (10928)
1446 -Only profile the page group that starts profiling to avoid profiling
1447 tools that shouldn't be profiled unless explicitly requested to.
1449 * JavaScriptCore.exp: Export new signature.
1450 * kjs/JSGlobalObject.cpp: Add unique identifiers to the JSGlobalObject.
1451 (KJS::JSGlobalObject::init):
1452 * kjs/JSGlobalObject.h: Ditto.
1453 (KJS::JSGlobalObject::setPageGroupIdentifier):
1454 (KJS::JSGlobalObject::pageGroupIdentifier):
1455 * profiler/Profiler.cpp: Check the identifier of the page group of the
1456 lexical global exec state and only profile if it matches the given page
1458 (KJS::Profiler::startProfiling):
1459 (KJS::Profiler::willExecute):
1460 (KJS::Profiler::didExecute):
1461 * profiler/Profiler.h: Ditto.
1462 (KJS::Profiler::Profiler):
1464 2008-04-24 Julien Chaffraix <jchaffraix@webkit.org>
1468 Bug 15940: Implement threading API for Qt
1469 https://bugs.webkit.org/show_bug.cgi?id=15940
1471 Original patch by Justin Haygood, tweaked by me.
1473 * JavaScriptCore.pri:
1474 * wtf/ThreadingQt.cpp: Added.
1475 (WTF::threadMapMutex):
1477 (WTF::establishIdentifierForThread):
1478 (WTF::clearThreadForIdentifier):
1479 (WTF::threadForIdentifier):
1480 (WTF::initializeThreading):
1481 (WTF::ThreadPrivate::getReturnValue):
1482 (WTF::ThreadPrivate::ThreadPrivate):
1483 (WTF::ThreadPrivate::run):
1484 (WTF::createThread):
1485 (WTF::waitForThreadCompletion): return !res to return
1486 0 on success (to match the pthreads implementation).
1487 (WTF::detachThread):
1488 (WTF::identifierByQthreadHandle):
1489 (WTF::currentThread):
1490 (WTF::Mutex::Mutex):
1491 (WTF::Mutex::~Mutex):
1493 (WTF::Mutex::tryLock):
1494 (WTF::Mutex::unlock):
1495 (WTF::ThreadCondition::ThreadCondition):
1496 (WTF::ThreadCondition::~ThreadCondition):
1497 (WTF::ThreadCondition::wait):
1498 (WTF::ThreadCondition::timedWait):
1499 (WTF::ThreadCondition::signal):
1501 2008-04-22 Darin Adler <darin@apple.com>
1505 - simplify use of HashTraits to prepare for some upcoming hash table changes
1507 * kjs/SymbolTable.h: Made SymbolTableIndexHashTraits derive from HashTraits<size_t>
1508 and specialize only the empty value.
1510 2008-04-23 Holger Hans Peter Freyther <zecke@selfish.org>
1514 Removed the #define for USE_SYSTEM_MALLOC that we set in WebKit.pri
1519 2008-04-21 Kevin McCullough <kmccullough@apple.com>
1523 <rdar://problem/5770054> JavaScript profiler (10928)
1524 - When stop profiling is called we need to stop the timers on all the
1525 functions that are still running.
1527 * profiler/FunctionCallProfile.cpp:
1528 (KJS::FunctionCallProfile::didExecute):
1529 (KJS::FunctionCallProfile::stopProfiling):
1530 * profiler/FunctionCallProfile.h:
1531 * profiler/Profiler.cpp:
1532 (KJS::Profiler::stopProfiling):
1534 2008-04-21 Alexey Proskuryakov <ap@webkit.org>
1538 Move collector main thread initialization from WebKit/win to KJS::initializeThreading.
1540 * kjs/InitializeThreading.cpp:
1541 (KJS::initializeThreading):
1543 2008-04-21 Adam Roben <aroben@apple.com>
1547 Reviewed by Alexey Proskuryakov.
1550 (KJS::UString::cost): Disable a warning about assigning a 32-bit
1551 size_t into a 31-bit size_t.
1553 2008-04-21 Simon Hausmann <hausmann@webkit.org>
1557 Made convertValueToQVariant accessible from within WebKit/qt/Api
1559 * bindings/qt/qt_runtime.h:
1561 2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
1565 Build fix for Qt 4.3
1567 * When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is
1568 always defined. Do this by adding defines to the compiler line
1569 * For users of our API this is not feasible. Every public header file should
1570 include qwebkitglobal.h. Define the QT_BEGIN_NAMESPACE and QT_END_NAMESPACE
1571 when we are building everything < 4.4.0 and don't have them defined.
1575 2008-04-19 Matt Lilek <webkit@mattlilek.com>
1577 Not reviewed, Windows build fix - copy the profiler headers in all
1578 configurations, not just Debug_Internal.
1580 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1582 2008-04-19 Mike Hommey <glandium@debian.org>
1584 Reviewed by Alp Toker.
1586 Don't build testkjs with rpath.
1590 2008-04-18 Kevin Ollivier <kevino@theolliviers.com>
1592 wx build fixes. Rename LocalStorage.h to LocalStorageEntry.h
1593 to avoid header detection issues between WebCore/storage/LocalStorage.h
1594 and it, and add $(PROFILER_SOURCES) to the wx JSCore build.
1596 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1597 * JavaScriptCore.xcodeproj/project.pbxproj:
1600 * kjs/JSVariableObject.h:
1601 * kjs/LocalStorage.h: Removed.
1602 * kjs/LocalStorageEntry.h: Copied from JavaScriptCore/kjs/LocalStorage.h.
1605 2008-04-18 Jan Michael Alonzo <jmalonzo@unpluggable.com>
1607 Reviewed by Alp Toker.
1609 http://bugs.webkit.org/show_bug.cgi?id=16620
1610 [GTK] Autotools make dist and make check support
1616 2008-04-18 Jon Honeycutt <jhoneycutt@apple.com>
1618 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Windows
1621 2008-04-11 Mark Rowe <mrowe@apple.com>
1623 Rubber-stamped by Antti Koivisto.
1625 Silence GCC 4.3 warnings by removing extraneous consts.
1630 2008-04-18 Kevin McCullough <kmccullough@apple.com>
1634 -<rdar://problem/5770054> JavaScript profiler (10928)
1635 - Use Deque instead of Vector since the profiler uses prepend a lot
1636 and deque is faster at that.
1638 * profiler/FunctionCallProfile.h:
1639 (KJS::FunctionCallProfile::milliSecs): Corrected the name to match
1642 (WTF::deleteAllValues):
1644 2008-04-18 Kevin McCullough <kmccullough@apple.com>
1646 Reviewed by Sam and Adam.
1648 -<rdar://problem/5770054> JavaScript profiler (10928)
1649 - Cleaned up the header file and made some functions static, added
1650 a new, sane, printing function, and fixed a few minor bugs.
1652 * JavaScriptCore.exp:
1653 * JavaScriptCore.xcodeproj/project.pbxproj:
1654 * profiler/FunctionCallProfile.cpp:
1655 (KJS::FunctionCallProfile::didExecute): Removed assertion that time is
1656 > 0 because at ms resolution that may not be true and only cross-
1657 platform way to get time differences is in ms.
1658 (KJS::FunctionCallProfile::printDataInspectorStyle): Added a new
1659 printing function for dumping data in a sane style.
1660 (KJS::FunctionCallProfile::printDataSampleStyle): Fixed a bug where we
1661 displayed too much precision when printing our floats. Also added logic
1662 to make sure we don't display 0 because that doesn't make sense for a
1664 * profiler/FunctionCallProfile.h:
1665 * profiler/Profiler.cpp: Moved functions that could be static into the
1666 implementation, and chaned the ASSERTs to early returns. I did this
1667 because console.profile() is a JS function and so was being profiled
1668 but asserting because the profiler had not been started! In the future
1669 I would like to put the ASSERTs back and not profile the calls to
1670 console.profile() and console.profileEnd().
1671 (KJS::Profiler::willExecute):
1672 (KJS::Profiler::didExecute):
1673 (KJS::getStackNames): Fixed a bug where the wrong ExecState was being
1675 (KJS::getFunctionName):
1676 (KJS::Profiler::printDataInspectorStyle):
1677 * profiler/Profiler.h:
1679 2008-04-18 Alexey Proskuryakov <ap@webkit.org>
1683 Fix leaks during plugin tests (which actually excercise background JS), and potential
1684 PAC brokenness that was not reported, but very likely.
1686 The leaks shadowed a bigger problem with Identifier destruction. Identifier::remove involves
1687 an IdentifierTable lookup, which is now a per-thread instance. Since garbage collection can
1688 currently happen on a different thread than allocation, a wrong table was used.
1690 No measurable change on SunSpider total, ~1% variation on individual tests.
1694 (KJS::UString::Rep::create):
1695 (KJS::UString::Rep::destroy):
1697 Replaced isIdentifier with a pointer to IdentifierTable, so that destruction can be done
1698 correctly. Took one bit from reportedCost, to avoid making UString::Rep larger (performance
1699 effect was measurable on SunSpider).
1701 * kjs/identifier.cpp:
1702 (KJS::IdentifierTable::IdentifierTable):
1703 (KJS::IdentifierTable::~IdentifierTable):
1704 (KJS::IdentifierTable::add):
1705 (KJS::IdentifierTable::remove):
1706 Make IdentifierTable a real class. Its destructor needs to zero out outstanding references,
1707 because some identifiers may briefly outlive it during thread destruction, and we don't want
1708 them to use their stale pointers.
1710 (KJS::LiteralIdentifierTable):
1711 (KJS::Identifier::add):
1712 Now that LiteralIdentifierTable is per-thread and can be destroyed not just during application
1713 shutdown, it is not appropriate to simply bump refcount for strings that get there; changed
1714 the table to hold RefPtrs.
1716 (KJS::CStringTranslator::translate):
1717 (KJS::UCharBufferTranslator::translate):
1718 (KJS::Identifier::addSlowCase):
1719 (KJS::Identifier::remove):
1721 (KJS::Identifier::add):
1722 Use and update UString::Rep::identifierTable as appropriate. Updating it is now done in
1723 IdentifierTable::add, not in translators.
1725 2008-04-18 Alexey Proskuryakov <ap@webkit.org>
1729 Get rid of static compareWithCompareFunctionArguments in array_instance.cpp.
1731 No change on SunSpider, CelticKane or iBench JavaScript. It is probable that in some cases,
1732 merge sort is still faster, but more investigation is needed to determine a new cutoff.
1733 Or possibly, it would be better to do what FIXME says (change to tree sort).
1735 Also, made arguments a local variable - not sure why it was a member of
1736 CompareWithCompareFunctionArguments.
1738 * kjs/array_instance.cpp:
1739 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1740 (KJS::CompareWithCompareFunctionArguments::operator()):
1741 (KJS::ArrayInstance::sort):
1743 2008-04-18 Simon Hausmann <hausmann@webkit.org>
1745 Build fix for gcc 4.3. Include stdio.h for printf.
1747 * profiler/FunctionCallProfile.cpp:
1748 * profiler/Profiler.cpp:
1750 2008-04-17 Jon Honeycutt <jhoneycutt@apple.com>
1754 * wtf/Platform.h: Add HAVE_ACCESSIBILITY to Platform.h.
1756 2008-04-17 Alexey Proskuryakov <ap@webkit.org>
1760 Thread static data destructors are not guaranteed to be called in any particular order;
1761 turn ThreadSpecific into a phoenix-style singleton to avoid accessing freed memory when
1762 deleted objects are interdependent (e.g. CommonIdentifiers and internal identifier tables).
1764 No change on SunSpider.
1766 * wtf/ThreadSpecific.h:
1767 (WTF::ThreadSpecific::Data::Data):
1772 2008-04-15 Srinivas Rao. M Hamse <msrinirao@gmail.com>
1774 Reviewed by Maciej Stachowiak.
1778 * kjs/nodes.h: CallerType definition made public for gcc 3.x compilation
1780 2008-04-16 Brady Eidson <beidson@apple.com>
1782 Reviewed by Sam Weinig
1784 Change ThreadSafeShared to act like RefCounted by starting out with a single ref by default
1787 (WTF::ThreadSafeShared::ThreadSafeShared):
1789 2008-04-16 Sam Weinig <sam@webkit.org>
1791 Reviewed by Geoffrey Garen.
1793 - To keep the behavior of the WebKit and JavaScriptCore API's the same,
1794 we need to hide the fact that the global object and the window object
1795 are no longer the same thing, and the the global object now changes on
1796 navigations. To do this, only the wrapper should ever be exposed. This
1797 fixes the two remaining spots where the internal global object is exposed,
1798 the windowScriptObject returned from [WebFrame windowObject] and the object
1799 return by calling JSContextGetGlobalObject on [WebFrame globalContext].
1801 * API/JSContextRef.cpp:
1802 (JSContextGetGlobalObject):
1803 This is a bit of a hack, this returns the "this" representation of the globalObject
1804 which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
1806 * API/JSObjectRef.cpp:
1807 (JSObjectSetProperty):
1808 Call the new putWithAttributes method instead of relying on lower-level calls.
1809 This is needed so that the window wrapper can forward the calls.
1811 * JavaScriptCore.exp:
1813 * kjs/JSGlobalObject.cpp:
1814 (KJS::JSGlobalObject::putWithAttributes):
1815 * kjs/JSGlobalObject.h:
1816 * kjs/JSVariableObject.h:
1817 (KJS::JSVariableObject::symbolTablePutWithAttributes):
1819 (KJS::ActivationImp::putWithAttributes):
1821 (KJS::ConstDeclNode::handleSlowCase):
1822 (KJS::ConstDeclNode::evaluateSingle):
1823 (KJS::EvalNode::processDeclarations):
1825 (KJS::JSObject::putWithAttributes):
1827 Rename initializeVariable to putWithAttributes and move it down to JSObject so it
1828 can be used for JSObjectSetProperty.
1830 2008-04-16 Kevin McCullough <kmccullough@apple.com>
1832 Reviewed by Sam and Geoff.
1834 -<rdar://problem/5770054> JavaScript profiler (10928)
1835 Inital profiler prototype
1837 * GNUmakefile.am: Added new files to project
1838 * JavaScriptCore.pri: Ditto
1839 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
1840 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto
1841 * JavaScriptCoreSources.bkl: Ditto
1842 * kjs/config.h: Put compiling flag in here.
1843 * kjs/function.cpp: Instrument calling the function eval().
1845 * kjs/interpreter.cpp: Instrument evaluating global scopes.
1846 (KJS::Interpreter::evaluate):
1847 * kjs/object.cpp: Instrument JS function calls.
1848 (KJS::JSObject::call):
1850 * profiler/FunctionCallProfile.cpp: Added.
1851 (KJS::FunctionCallProfile::FunctionCallProfile):
1852 (KJS::FunctionCallProfile::~FunctionCallProfile):
1853 (KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer.
1854 (KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer.
1855 (KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile.
1856 (KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one.
1857 (KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
1858 * profiler/FunctionCallProfile.h: Added.
1859 (KJS::FunctionCallProfile::FunctionCallProfile):
1860 (KJS::FunctionCallProfile::~FunctionCallProfile):
1861 (KJS::FunctionCallProfile::functionName):
1862 (KJS::FunctionCallProfile::microSecs):
1863 * profiler/Profiler.cpp: Added.
1864 (KJS::Profiler::profiler):
1865 (KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns)
1866 (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.
1867 (KJS::Profiler::stopProfiling): Stop collecting profile information.
1868 (KJS::Profiler::willExecute): Same as above.
1869 (KJS::Profiler::didExecute): Same as above.
1870 (KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it.
1871 (KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack.
1872 (KJS::Profiler::getFunctionName): Get the function name from the given parameter.
1873 (KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
1874 (KJS::Profiler::debugLog):
1875 * profiler/Profiler.h: Added.
1876 (KJS::Profiler::Profiler):
1878 2008-04-16 Sam Weinig <sam@webkit.org>
1880 Reviewed by Darin Adler.
1882 - Remove kjs_ prefix from strtod, dtoa, and freedtoa and put it
1883 in the KJS namespace.
1884 - Make strtod, dtoa, and freedtoa c++ functions instead of extern "C".
1885 - Remove mode switching from dtoa. ~2% improvement on test 26.
1886 - Removes all unnecessary #defines from dtoa code.
1888 * JavaScriptCore.exp:
1903 * kjs/number_object.cpp:
1904 (KJS::integer_part_noexp):
1905 (KJS::numberProtoFuncToExponential):
1907 (KJS::UString::from):
1908 (KJS::UString::toDouble):
1910 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1914 Get rid of static execForCompareByStringForQSort in array_instance.cpp.
1916 No change on SunSpider, CelticKane or iBench JavaScript.
1918 * kjs/array_instance.cpp:
1919 (KJS::ArraySortComparator::ArraySortComparator):
1920 (KJS::ArraySortComparator::operator()):
1921 (KJS::ArrayInstance::sort):
1922 Switch slow case to std::sort, so that ExecState can be passed in a comparator.
1924 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1926 Reviewed by Adam Roben.
1930 * kjs/CommonIdentifiers.cpp:
1931 * kjs/CommonIdentifiers.h:
1934 * kjs/identifier.cpp:
1936 * wtf/ThreadSpecific.h:
1938 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1942 * kjs/date_object.cpp:
1943 * kjs/date_object.h:
1944 Don't include DateMath.h from date_object.h, as the latter is used from WebCore, while
1945 where the former is not available.
1947 2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
1949 Unreviewed build fix for MSVC. It does not want to have
1950 WTF in the KJS namespace.
1952 * kjs/CommonIdentifiers.h:
1954 2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org>
1956 Unreviewed build fix for gcc.
1958 ::msToGregorianDateTime is not known to it.
1960 * kjs/date_object.cpp:
1961 (KJS::DateInstance::msToGregorianDateTime):
1963 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1965 Reviewed by Oliver Hunt.
1967 Initialize threadMapMutex safely (as already done in ThreadingWin).
1969 * wtf/ThreadingGtk.cpp:
1970 (WTF::threadMapMutex):
1971 (WTF::initializeThreading):
1972 * wtf/ThreadingPthreads.cpp:
1973 (WTF::threadMapMutex):
1974 (WTF::initializeThreading):
1976 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
1978 Reviewed by Adam Roben.
1980 Cache Gregorian date/time structure on DateInstance objects for 1.027x SunSpider speedup
1981 (1.65x on date-format-xparb, 1.13x on date-format-tofte).
1984 (KJS::GregorianDateTime::copyFrom): Added. It presumably makes sense to keep GregorianDateTime
1985 Noncopyable, so it's not just operator=.
1987 * kjs/date_object.h: Added a per-object cache.
1989 * kjs/date_object.cpp:
1990 (KJS::DateInstance::DateInstance):
1991 (KJS::DateInstance::msToGregorianDateTime):
1992 (KJS::dateProtoFuncToString):
1993 (KJS::dateProtoFuncToUTCString):
1994 (KJS::dateProtoFuncToDateString):
1995 (KJS::dateProtoFuncToTimeString):
1996 (KJS::dateProtoFuncToLocaleString):
1997 (KJS::dateProtoFuncToLocaleDateString):
1998 (KJS::dateProtoFuncToLocaleTimeString):
1999 (KJS::dateProtoFuncGetFullYear):
2000 (KJS::dateProtoFuncGetUTCFullYear):
2001 (KJS::dateProtoFuncToGMTString):
2002 (KJS::dateProtoFuncGetMonth):
2003 (KJS::dateProtoFuncGetUTCMonth):
2004 (KJS::dateProtoFuncGetDate):
2005 (KJS::dateProtoFuncGetUTCDate):
2006 (KJS::dateProtoFuncGetDay):
2007 (KJS::dateProtoFuncGetUTCDay):
2008 (KJS::dateProtoFuncGetHours):
2009 (KJS::dateProtoFuncGetUTCHours):
2010 (KJS::dateProtoFuncGetMinutes):
2011 (KJS::dateProtoFuncGetUTCMinutes):
2012 (KJS::dateProtoFuncGetSeconds):
2013 (KJS::dateProtoFuncGetUTCSeconds):
2014 (KJS::dateProtoFuncGetTimezoneOffset):
2015 (KJS::setNewValueFromTimeArgs):
2016 (KJS::setNewValueFromDateArgs):
2017 (KJS::dateProtoFuncSetYear):
2018 (KJS::dateProtoFuncGetYear):
2019 Use the cache when converting.
2021 2008-04-16 Alexey Proskuryakov <ap@webkit.org>
2025 Implement an abstraction for thread-specific storage, use it to get rid of some static objects.
2027 SunSpider results were not conclusive, possibly up to 0.2% slowdown.
2029 * JavaScriptCore.xcodeproj/project.pbxproj:
2030 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2031 Added ThreadSpecific.h
2033 * wtf/ThreadSpecific.h: Added.
2034 (WTF::::ThreadSpecific):
2035 (WTF::::~ThreadSpecific):
2041 Only implemented for platforms that use pthreads.
2043 * kjs/CommonIdentifiers.cpp:
2044 (KJS::CommonIdentifiers::shared):
2045 * kjs/CommonIdentifiers.h:
2046 * kjs/InitializeThreading.cpp:
2047 (KJS::initializeThreading):
2051 * kjs/identifier.cpp:
2052 (KJS::identifierTable):
2053 (KJS::literalIdentifierTable):
2054 (KJS::Identifier::initializeIdentifierThreading):
2059 Make static instances per-thread.
2061 2008-04-15 Anders Carlsson <andersca@apple.com>
2065 Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
2067 * Configurations/JavaScriptCore.xcconfig:
2069 2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com>
2073 Fix compilation with Qt namespaces
2075 Qt can be configured to have all of its classes inside a specified namespaces.
2076 This is for example used in plugin/component environments like Eclipse.
2078 This change makes it possible to let the Qt port compile against a namespaced
2079 Qt by the use of macros Qt provides to properly forward declare Qt classes in
2082 * wtf/unicode/qt4/UnicodeQt4.h:
2084 2008-04-14 Anders Carlsson <andersca@apple.com>
2088 Don't leak the prototype class.
2090 * API/JSClassRef.cpp:
2091 (OpaqueJSClass::create):
2093 2008-04-14 Steve Falkenburg <sfalken@apple.com>
2097 * wtf/ThreadingWin.cpp:
2099 2008-04-14 Alexey Proskuryakov <ap@webkit.org>
2101 Reviewed by Adam Roben.
2103 https://bugs.webkit.org/show_bug.cgi?id=18488
2104 FastMalloc doesn't release thread-specific data on Windows
2106 * wtf/ThreadingWin.cpp:
2107 (WTF::threadMapMutex): (WTF::initializeThreading): Call threadMapMutex once to initialize the static safely.
2108 (WTF::ThreadFunctionInvocation::ThreadFunctionInvocation): Added a structure to wrap thread entry point and arguments.
2109 (WTF::wtfThreadEntryPoint): Make sure to end all WTF threads with pthread_exit(), to give pthreads-win32 a chance to call
2110 destructors of thread-specific data.
2111 (WTF::createThread): Use _beginthreadex instead of CreateThread, because MSDN says so. Also removed a call to CreateEvent,
2112 for which I could see no reason at all.
2114 2008-04-14 Alexey Proskuryakov <ap@webkit.org>
2116 Touched a file to make JavaScriptCore.vcproj rebuild.
2120 2008-04-14 Adam Roben <aroben@apple.com>
2124 Rubberstamped by Alexey Proskuryakov.
2126 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable
2127 the "potentially uninitialized variable" warning for grammar.cpp, as
2128 it seems to be incorrect. yylval gets initialized by the lexer, but
2129 MSVC doesn't seem to understand this.
2131 2008-04-11 Antti Koivisto <antti@apple.com>
2135 Add default hash for pairs of hashable types.
2137 * wtf/HashFunctions.h:
2138 (WTF::PairHash::hash):
2139 (WTF::PairHash::equal):
2142 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2146 Make DateMath.cpp thread safe.
2148 No measurable change on SunSpider (should be a very small speedup).
2151 (KJS::mimimumYearForDST): (KJS::equivalentYearForDST): Got rid of double caching of the
2152 same precomputed value.
2153 (KJS::calculateUTCOffset): (KJS::getUTCOffset): Factored actual UTC offset calculation code
2154 out of getUTCOffset(), and notification setup into initDateMath().
2156 (KJS::initDateMath): Added.
2159 * kjs/InitializeThreading.cpp:
2160 (KJS::initializeThreading):
2161 Added initDateMath().
2163 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2169 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2171 Tiger build fix. Forward declaring a union didn't work for whatever reason, make the
2180 2008-04-11 Alexey Proskuryakov <ap@webkit.org>
2184 Generate a pure (re-entrant) parser with Bison.
2186 No change on SunSpider.
2189 (KJS::Parser::parse):
2195 Pass state as function arguments, instead of global data. Don't call lexer() as often as
2196 before, as this function is about to become slower due to thread-specific storage.
2199 (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are
2200 already taken care of. This is a small speedup, compensating for a small slowdown caused
2201 by switching Bison mode.
2203 2008-04-10 Alexey Proskuryakov <ap@webkit.org>
2207 https://bugs.webkit.org/show_bug.cgi?id=18402
2208 REGRESSION: visited element handling is incorrect in nested join/toString calls
2210 No change on SunSpider total, possibly a tiny improvement (about 0.1%).
2212 Test: fast/js/array-tostring-and-join.html
2214 * kjs/JSGlobalObject.h:
2215 (KJS::JSGlobalObject::visitedElements): Store visited elements HashSet here, making it
2216 common to toString/toLocalizedString/join again.
2218 * kjs/array_object.cpp:
2219 (KJS::arrayProtoFuncToString):
2220 (KJS::arrayProtoFuncToLocaleString):
2221 (KJS::arrayProtoFuncJoin):
2222 Got rid of static variables. Replaced UString with Vector to avoid O(n^2) behavior and
2228 (WTF::::reserveCapacity):
2231 Added null checks, so that Vector methods don't crash when out of memory. The caller should
2232 check that data pointer is not null before proceeding.
2234 2008-04-10 Mark Rowe <mrowe@apple.com>
2236 Reviewed by Maciej Stachowiak.
2238 Fix https://bugs.webkit.org/show_bug.cgi?id=18367 and the many dupes.
2239 Bug 18367: Crash during celtic kane js speed 2007 test
2241 GCC 4.2 on x86_64 Linux decided to reorder the local variables in markCurrentThreadConservatively's
2242 stack frame. This lead to the range of addresses the collector treated as stack to exclude the
2243 contents of volatile registers that markCurrentThreadConservatively forces onto the stack. This was
2244 leading to objects being prematurely collected if the only reference to them was via a register at
2245 the time a collection occurred.
2247 The fix for this is to move the calculation of the top of the stack into a NEVER_INLINE function
2248 that is called from markCurrentThreadConservatively. This forces the dummy variable we use for
2249 determining the top of stack to be in a different stack frame which prevents the compiler from
2250 reordering it relative to the registers that markCurrentThreadConservatively forces onto the stack.
2252 * kjs/collector.cpp:
2253 (KJS::Collector::markCurrentThreadConservativelyInternal):
2254 (KJS::Collector::markCurrentThreadConservatively):
2257 2008-04-10 Adam Roben <aroben@apple.com>
2259 VC++ Express build fix
2261 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Link against user32.lib so
2262 that anyone who links against WTF.lib will get user32.lib
2265 2008-04-09 Adam Roben <aroben@apple.com>
2267 VC++ Express build fix
2269 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
2272 2008-04-09 Adam Roben <aroben@apple.com>
2276 * JavaScriptCore.exp: Export isMainThread.
2278 2008-04-09 Adam Roben <aroben@apple.com>
2282 * wtf/AlwaysInline.h: Make sure to #include Platform.h before using
2283 the macros it defines.
2285 2008-04-08 Mark Rowe <mrowe@apple.com>
2287 Export WTF::initializeThreading() from JavaScriptCore.
2289 * JavaScriptCore.exp:
2291 2008-04-04 Sam Weinig <sam@webkit.org>
2293 Reviewed by Geoffrey Garen.
2295 First step in implementing the "split window"
2297 - Add a GlobalThisValue to ExecState which should be used
2298 in places that used to implement the "use the global object
2299 as this if null" rule.
2300 - Factor out lookupGetter/lookupSetter into virtual methods
2301 on JSObject so that they can be forwarded.
2302 - Make defineGetter/defineSetter virtual methods for the same
2304 - Have PrototypeReflexiveFunction store the globalObject used
2305 to create it so that it can be used to get the correct thisObject
2308 * API/JSObjectRef.cpp:
2309 (JSObjectCallAsFunction):
2310 * JavaScriptCore.exp:
2312 * kjs/ExecState.cpp:
2313 (KJS::ExecState::ExecState):
2314 (KJS::GlobalExecState::GlobalExecState):
2316 (KJS::ExecState::globalThisValue):
2317 * kjs/ExecStateInlines.h:
2318 (KJS::ExecState::ExecState):
2319 (KJS::FunctionExecState::FunctionExecState):
2320 * kjs/JSGlobalObject.cpp:
2321 (KJS::JSGlobalObject::reset):
2322 (KJS::JSGlobalObject::toGlobalObject):
2323 * kjs/JSGlobalObject.h:
2324 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
2325 (KJS::JSGlobalObject::JSGlobalObject):
2326 * kjs/array_instance.cpp:
2327 (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2328 (KJS::compareWithCompareFunctionForQSort):
2329 * kjs/array_object.cpp:
2330 (KJS::arrayProtoFuncSort):
2331 (KJS::arrayProtoFuncFilter):
2332 (KJS::arrayProtoFuncMap):
2333 (KJS::arrayProtoFuncEvery):
2334 (KJS::arrayProtoFuncForEach):
2335 (KJS::arrayProtoFuncSome):
2337 (KJS::FunctionImp::callAsFunction):
2338 (KJS::ActivationImp::toThisObject):
2339 (KJS::globalFuncEval):
2340 (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
2341 (KJS::PrototypeReflexiveFunction::mark):
2343 (KJS::PrototypeReflexiveFunction::cachedGlobalObject):
2344 * kjs/function_object.cpp:
2345 (KJS::functionProtoFuncApply):
2346 (KJS::functionProtoFuncCall):
2348 (KJS::ExpressionNode::resolveAndCall):
2349 (KJS::FunctionCallValueNode::evaluate):
2350 (KJS::LocalVarFunctionCallNode::inlineEvaluate):
2351 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
2352 (KJS::FunctionCallBracketNode::evaluate):
2353 (KJS::FunctionCallDotNode::inlineEvaluate):
2355 (KJS::JSObject::call):
2356 (KJS::JSObject::put):
2357 (KJS::tryGetAndCallProperty):
2358 (KJS::JSObject::lookupGetter):
2359 (KJS::JSObject::lookupSetter):
2360 (KJS::JSObject::toThisObject):
2361 (KJS::JSObject::toGlobalObject):
2362 (KJS::JSObject::fillGetterPropertySlot):
2364 * kjs/object_object.cpp:
2365 (KJS::objectProtoFuncLookupGetter):
2366 (KJS::objectProtoFuncLookupSetter):
2367 * kjs/string_object.cpp:
2370 2008-04-08 Brady Eidson <beidson@apple.com>
2372 Encourage Windows to rebuild - AGAIN...
2376 2008-04-08 Adam Roben <aroben@apple.com>
2380 * JavaScriptCore.exp: Add callOnMainThread, and sorted the list.
2382 2008-04-08 Brady Eidson <beidson@apple.com>
2384 Rubberstamped by Adam Roben
2386 Touch some files to *strongly* encourage Windows to rebuilt with DOM_STORAGE enabled
2390 2008-04-08 Adam Roben <aroben@apple.com>
2392 Move callOnMainThread to WTF
2394 Reviewed by Alexey Proskuryakov.
2397 * JavaScriptCore.pri:
2398 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2399 * JavaScriptCore.xcodeproj/project.pbxproj:
2400 * JavaScriptCoreSources.bkl:
2403 * wtf/MainThread.cpp:
2405 * wtf/gtk/MainThreadGtk.cpp:
2406 * wtf/mac/MainThreadMac.mm:
2407 * wtf/qt/MainThreadQt.cpp:
2408 * wtf/win/MainThreadWin.cpp:
2409 * wtf/wx/MainThreadWx.cpp:
2410 Moved here from WebCore/platform. Replaced all instances of "WebCore"
2413 * kjs/bool_object.cpp: Touched to force JavaScriptCore.vcproj to
2415 to the WTF namespace.
2416 * wtf/ThreadingWin.cpp:
2417 (WTF::initializeThreading): Call initializeMainThread.
2419 2008-04-07 Brady Eidson <beidson@apple.com>
2421 Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
2423 * Configurations/JavaScriptCore.xcconfig:
2425 2008-04-07 Adam Roben <aroben@apple.com>
2429 * wtf/ThreadingWin.cpp: Back out some changes I didn't mean to land.
2431 2008-04-07 Adam Roben <aroben@apple.com>
2433 Add WTF::isMainThread
2435 Reviewed by Alexey Proskuryakov.
2437 * wtf/Threading.h: Declare the new function.
2438 * wtf/ThreadingGtk.cpp:
2439 (WTF::initializeThreading): Initialize the main thread identifier.
2440 (WTF::isMainThread): Added.
2441 * wtf/ThreadingNone.cpp: Ditto ThreadingGtk.cpp.
2442 (WTF::initializeThreading):
2443 (WTF::isMainThread):
2444 * wtf/ThreadingPthreads.cpp: Ditto.
2445 (WTF::initializeThreading):
2446 (WTF::isMainThread):
2447 * wtf/ThreadingWin.cpp: Ditto.
2448 (WTF::initializeThreading):
2449 (WTF::isMainThread):
2451 2008-04-06 Alexey Proskuryakov <ap@webkit.org>
2455 Make UString thread-safe.
2457 No change on SunSpider total, although individual tests have changed a lot, up to 3%.
2459 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Call UString::null() to initialize
2462 * kjs/identifier.cpp:
2463 (KJS::CStringTranslator::translate):
2464 (KJS::UCharBufferTranslator::translate):
2465 Use "true" for a boolean value instead of 1, because it's C++.
2468 (KJS::CString::adopt): Added a method to create from a char* buffer without copying.
2469 (KJS::UString::Rep::ref): Removed an assertion for JSLock::lockCount, as it's no longer
2470 necessary to hold JSLock when working with strings.
2471 (KJS::UString::Rep::deref): Ditto.
2472 (KJS::UString::Rep::isStatic): Added a field to quickly determine that this is an empty
2473 or null static string.
2476 (KJS::): Removed normalStatBufferSize and statBufferSize, as there is no reason to have such
2477 an advanced implementation of a debug-only ascii() method. Removed a long-obsolete comment
2479 (KJS::UString::Rep::createCopying): Removed an assertion for JSLock::lockCount.
2480 (KJS::UString::Rep::create): Ditto.
2481 (KJS::UString::Rep::destroy): Ditto. Do not do anything for static null and empty strings,
2482 as refcounting is not reliable for those. Reordered branches for a noticeable speed gain -
2483 apparently this functiton is hot enough for SunSpider to see an effect from this!
2484 (KJS::UString::null): Moved a star, added a comment.
2485 (KJS::UString::cstring): Reimplemented to not call ascii(), which is not thread-safe.
2486 (KJS::UString::ascii): Simplified statBuffer handling logic.
2487 (KJS::UString::toDouble): Use cstring() instead of ascii().
2489 2008-04-02 Mark Rowe <mrowe@apple.com>
2491 Reviewed by Oliver Hunt.
2493 Ensure that debug symbols are generated for x86_64 and ppc64 builds.
2495 * Configurations/Base.xcconfig:
2497 2008-04-01 Christian Dywan <christian@imendio.com>
2499 Build fix for GCC 4.3.
2501 * wtf/unicode/icu/CollatorICU.cpp: include string.h
2503 2008-04-01 Alexey Proskuryakov <ap@webkit.org>
2505 Rubber-stamped by Darin.
2507 Turn off using 64-bit arithmetic on 32-bit hardware, as dtoa own code is faster than
2508 compiler-provided emulation.
2510 1% speedup on Acid3 test 26.
2514 2008-04-01 Alexey Proskuryakov <ap@webkit.org>
2518 Make MathExtras.h thread safe.
2520 * kjs/math_object.cpp:
2521 (KJS::mathProtoFuncRandom): If threading is enabled, rely on initializeThreading to call
2525 * wtf/ThreadingGtk.cpp:
2526 (WTF::initializeThreading):
2527 * wtf/ThreadingNone.cpp:
2528 (WTF::initializeThreading):
2529 * wtf/ThreadingPthreads.cpp:
2530 (WTF::initializeThreading):
2531 * wtf/ThreadingWin.cpp:
2532 (WTF::initializeThreading):
2533 Call wtf_random_init(); made the function non-inline to avoid having to include too many
2534 headers in Threading.h.
2536 2008-03-31 Eric Seidel <eric@webkit.org>
2540 Make matching of regexps using ^ much faster
2541 http://bugs.webkit.org/show_bug.cgi?id=18086
2543 * pcre/pcre_compile.cpp:
2545 (branchNeedsLineStart):
2546 * pcre/pcre_exec.cpp:
2549 * pcre/pcre_internal.h:
2551 2008-03-29 Alexey Proskuryakov <ap@webkit.org>
2553 Reviewed by Oliver Hunt.
2555 <rdar://problem/5829556> REGRESSION: Leak in KJS::initializeThreading()
2557 * kjs/InitializeThreading.cpp: (KJS::initializeThreading): There is no guarantee that
2558 initializeThreading() is called only once; check that the mutex hasn't been already allocated.
2560 2008-03-29 Oliver Hunt <oliver@apple.com>
2564 Bug 17924: Crash in KJS::ConstDeclNode::evaluate with |with| and |const|
2565 <http://bugs.webkit.org/show_bug.cgi?id=17924>
2566 <rdar://problem/5806933>
2568 It turns out this is trivially avoidable if we just match firefox's
2569 semantics and ensure that an assignment in a const declaration always
2570 writes to the variable object.
2573 (KJS::ConstDeclNode::handleSlowCase):
2575 2008-03-28 Alexey Proskuryakov <ap@webkit.org>
2577 Reviewed by Sam Weinig.
2579 Fix a dtoa thread safety issue.
2581 WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety
2582 compiled in for dtoa.
2584 This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with
2585 his recent improvement.
2590 Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was
2591 in the presence of locking (but somewhat slower in single-threaded case).
2592 (Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to
2593 restructure the code to avoid significant performance implications).
2594 (Bigint::lshift): Rewrote to avoid an allocation, if possible.
2597 (Bigint::kjs_freedtoa):
2599 Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS.
2601 * kjs/InitializeThreading.cpp: Added.
2602 (KJS::initializeThreading):
2603 * kjs/InitializeThreading.h: Added.
2604 Initialize threading at KJS level, if enabled.
2606 * kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading.
2608 * kjs/testkjs.cpp: (kjsmain): Call initializeThreading.
2610 * JavaScriptCore.exp: Export KJS::initializeThreading.
2613 * JavaScriptCore.exp:
2614 * JavaScriptCore.pri:
2615 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2616 * JavaScriptCoreSources.bkl:
2617 * JavaScriptCore.xcodeproj/project.pbxproj:
2618 Added InitializeThreading.{h,cpp}.
2620 * wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only
2621 to be called from KJS::initializeThreading, and having it in the global namespace is useless.
2623 2008-03-28 Brady Eidson <beidson@apple.com>
2627 Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore
2629 * JavaScriptCore.exp:
2630 * JavaScriptCore.xcodeproj/project.pbxproj:
2632 2008-03-27 Darin Adler <darin@apple.com>
2634 Reviewed by Mark Rowe.
2636 <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
2637 compiled length calculated incorrectly.
2639 * pcre/pcre_compile.cpp:
2640 (multiplyWithOverflowCheck):
2641 (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
2642 and bail with an error rather than returning incorrect results.
2644 2008-03-26 Mark Rowe <mrowe@apple.com>
2646 Rubber-stamped by Brady Eidson.
2648 Update FEATURE_DEFINES to be consistent with the other locations in which it is defined.
2650 * Configurations/JavaScriptCore.xcconfig:
2652 2008-03-26 Adam Roben <aroben@apple.com>
2654 Fix Bug 18060: Assertion failure (JSLock not held) beneath
2655 JSCallbackObject<Base>::toString
2657 <http://bugs.webkit.org/show_bug.cgi?id=18060>
2659 Reviewed by Geoff Garen.
2663 * API/JSCallbackObjectFunctions.h:
2664 (KJS::JSCallbackObject<Base>::toString): Make the DropAllLocks
2665 instance only be in scope while calling convertToType.
2670 (MyObject_convertToType): Implement type conversion to string.
2671 * API/testapi.js: Add a test for type conversion to string.
2673 2008-03-26 Adam Roben <aroben@apple.com>
2677 * kjs/array_instance.cpp: Touched this.
2678 * wtf/HashFunctions.h:
2679 (WTF::intHash): Added 8- and 16-bit versions of intHash.
2681 2008-03-26 Adam Roben <aroben@apple.com>
2683 Force JSC headers to be copied by touching a file
2685 * kjs/array_instance.cpp:
2686 (KJS::ArrayInstance::getPropertyNames):
2688 2008-03-26 Adam Roben <aroben@apple.com>
2690 Windows build fix after r31324
2694 Added HashTable plumbing to support using wchar_t as a key type.
2696 * wtf/HashFunctions.h:
2700 2008-03-26 Maciej Stachowiak <mjs@apple.com>
2704 - JSC part of fix for "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)"
2705 http://bugs.webkit.org/show_bug.cgi?id=18118
2707 * wtf/HashFunctions.h:
2712 2008-03-26 Alexey Proskuryakov <ap@webkit.org>
2716 Cache C string identifiers by address, not value, assuming that C strings can only
2719 1% speedup on Acid3 test 26.
2721 * kjs/identifier.cpp:
2722 (KJS::literalIdentifierTable):
2723 (KJS::Identifier::add):
2724 Added a new table to cache UString::Reps created from C strings by address. Elements are
2725 never removed from this cache, as only predefined identifiers can get there.
2728 (KJS::Identifier::Identifier): Added a warning.
2730 2008-03-26 Alexey Proskuryakov <ap@webkit.org>
2732 Rubber-stamped by Maciej.
2734 An assertion was failing in function-toString-object-literals.html when parsing 1e-500.
2735 The condition existed before, and got uncovered by turning compiled-out dtoa checks into
2738 The assertion was verifying that the caller wasn't constructing a Bigint from 0.
2739 This might have had some reason behind it originally, but I couldn't find any,
2740 and this doesn't look like a reasonable requirement.
2742 * kjs/dtoa.cpp: (d2b): Removed the assertion (two copies in different code paths).
2744 2008-03-25 Adam Roben <aroben@apple.com>
2746 Fix Bug 18077: Integrate testapi.c into the Windows build
2748 <http://bugs.webkit.org/show_bug.cgi?id=18077>
2750 Reviewed by Steve Falkenburg.
2752 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Added.
2754 2008-03-25 Adam Roben <aroben@apple.com>
2756 Make testapi.c compile under MSVC
2758 Currently you must compile testapi.c as C++ code since MSVC does not
2759 support many C features that GCC does.
2761 Reviewed by Steve Falkenburg.
2764 (nan): Added an implementation of this for MSVC.
2765 (assertEqualsAsUTF8String): Use malloc instead of dynamically-sized
2767 (assertEqualsAsCharactersPtr): Ditto.
2768 (print_callAsFunction): Ditto.
2769 (main): Ditto, and explicitly cast from UniChar* to JSChar*.
2771 2008-03-25 Adam Roben <aroben@apple.com>
2773 Stop using JavaScriptCore's custom stdbool.h and stdint.h on Windows
2775 We can't remove the os-win32 directory yet because other ports (at
2776 least wx) are still relying on it.
2778 Reviewed by Steve Falkenburg.
2780 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2781 - Made all the include paths match the one for the Debug
2782 configuration (these got out of sync in r30797)
2783 - Removed os-win32 from the include path
2784 - Removed os-win32 from the directories we copy to $WebKitOutputDir.
2785 - Removed stdint.h from the project
2786 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2787 Delete the files that we may have previously copied from the os-win32
2790 2008-03-25 Alexey Proskuryakov <ap@webkit.org>
2794 * kjs/dtoa.cpp: Include stdint.h.
2796 2008-03-25 Alexey Proskuryakov <ap@webkit.org>
2798 Rubber-stamped by Darin.
2800 Cleanup dtoa.cpp style.
2822 (Bigint::kjs_strtod):
2825 (Bigint::nrv_alloc):
2826 (Bigint::kjs_freedtoa):
2830 2008-03-24 Darin Adler <darin@apple.com>
2834 - convert a JavaScript immediate number to a string more efficiently
2836 2% speedup of Acid3 test 26
2838 * kjs/JSImmediate.cpp:
2839 (KJS::JSImmediate::toString): Take advantage of the fact that all immediate
2840 numbers are integers, and use the faster UString function for formatting integers
2841 instead of the slower one that works for floating point. I think this is a leftover
2842 from when immediate numbers were floating point.
2844 2008-03-23 Sam Weinig <sam@webkit.org>
2846 Reviewed by Darin Adler.
2848 Fix http://bugs.webkit.org/show_bug.cgi?id=18048
2849 The "thisObject" parameter to JSEvaluateScript is not used properly
2851 Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created
2855 (main): Add tests for setting the thisObject when calling JSEvaluateScript.
2857 * kjs/ExecState.cpp:
2858 (KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment.
2860 2008-03-22 Jesse Ruderman <jruderman@gmail.com>
2862 Reviewed by Sam Weinig. Landed by eseidel.
2864 Make testkjs flush stdout after printing.
2866 * JavaScriptCore.xcodeproj/project.pbxproj:
2870 2008-03-21 Oliver Hunt <oliver@apple.com>
2874 Optimise lookup of Math, undefined, NaN and Infinity
2876 Added a method to JSVariableObject to allow us to inject DontDelete properties
2877 into the symbol table and localStorage. This results in a 0.4% progression in
2878 SunSpider, with a 8% gain in math-partial-sums.
2880 * kjs/JSGlobalObject.cpp:
2881 (KJS::JSGlobalObject::reset):
2882 * kjs/JSVariableObject.h:
2883 (KJS::JSVariableObject::symbolTableInsert):
2885 2008-03-21 Oliver Hunt <oliver@apple.com>
2887 Reviewed by Geoff Garen.
2889 Global properties that use LocalStorage are not correctly listed as enumerable.
2891 The problem was caused by JSObject::getPropertyAttributes not being aware
2892 of the JSVariableObject SymbolTable. The fix is to make getPropertyAttributes
2893 virtual and override in JSVariableObject. This does not produce any performance
2896 * JavaScriptCore.exp:
2897 * kjs/JSVariableObject.cpp:
2898 (KJS::JSVariableObject::getPropertyNames):
2899 (KJS::JSVariableObject::getPropertyAttributes):
2900 * kjs/JSVariableObject.h:
2903 2008-03-21 Arkadiusz Miskiewicz <arekm@maven.pl>
2905 Webkit does not build on linux powerpc
2907 <http://bugs.webkit.org/show_bug.cgi?id=17019>
2909 Reviewed by David Kilzer.
2912 (TCMalloc_SpinLock::Unlock):
2914 2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com>
2918 http://bugs.webkit.org/show_bug.cgi?id=17981
2920 Add javascriptcore_cppflags to Programs_minidom_CPPFLAGS.
2924 2008-03-21 Alexey Proskuryakov <ap@webkit.org>
2926 Reviewed by Oliver Hunt.
2928 Consolidate static identifier initializers within CommonIdentifiers.
2930 No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).
2932 * kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized
2933 throughout the code.
2935 * kjs/date_object.cpp:
2936 (KJS::DateObjectImp::DateObjectImp):
2937 * kjs/function_object.cpp:
2938 (KJS::FunctionPrototype::FunctionPrototype):
2939 * kjs/object_object.cpp:
2940 (KJS::ObjectPrototype::ObjectPrototype):
2941 * kjs/regexp_object.cpp:
2942 (KJS::RegExpPrototype::RegExpPrototype):
2943 Use the values from CommonIdentifiers.
2945 * kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
2948 (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
2951 (wtf_atan2): Having local variables for numeric_limits constants is good for readability,
2952 but there is no reason to keep them static.
2954 * JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head.
2956 2008-03-20 Oliver Hunt <oliver@apple.com>
2960 Fix for leak introduced by inline ScopeChainNode use
2962 To avoid any extra branches when managing an inline ScopeChainNode
2963 in the ScopeChain the inline node gets inserted with a refcount of
2964 2. This meant than when the ScopeChain was destroyed the ScopeChainNodes
2965 above the inline node would be leaked.
2967 We resolve this by manually popping the inline node in the
2968 FunctionExecState destructor.
2970 * JavaScriptCore.xcodeproj/project.pbxproj:
2971 * kjs/ExecStateInlines.h:
2972 (KJS::FunctionExecState::~FunctionExecState):
2973 * kjs/scope_chain.h:
2974 (KJS::ScopeChain::popInlineScopeNode):
2976 2008-03-20 Mark Rowe <mrowe@apple.com>
2978 Reviewed by Sam Weinig.
2980 Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
2981 This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
2984 * Configurations/JavaScriptCore.xcconfig:
2986 2008-03-20 David Krause <david.krause@gmail.com>
2988 Reviewed by David Kilzer.
2990 Fix http://bugs.webkit.org/show_bug.cgi?id=17923
2991 Bug 17923: ARM platform endian defines inaccurate
2994 Replaced !defined(__ARMEL__) check with !defined(__VFP_FP__)
2995 for PLATFORM(MIDDLE_ENDIAN)
2997 2008-03-20 Maciej Stachowiak <mjs@apple.com>
3001 * JavaScriptCore.xcodeproj/project.pbxproj: install Activation.h as private
3003 2008-03-20 Maciej Stachowiak <mjs@apple.com>
3007 - reduce function call overhead for 1.014x speedup on SunSpider
3009 I moved some functions from ExecState.cpp to ExecStateInline.h and
3010 from JSGlobalObject.cpp to JSGlobalObject.h, and declared them
3011 inline; machine function call overhead for these was hurting JS
3012 funcion call overhead.
3014 * kjs/ExecState.cpp:
3015 * kjs/ExecStateInlines.h: Added.
3016 (KJS::ExecState::ExecState):
3017 (KJS::ExecState::~ExecState):
3018 (KJS::FunctionExecState::FunctionExecState):
3019 (KJS::FunctionExecState::~FunctionExecState):
3020 * kjs/JSGlobalObject.cpp:
3021 * kjs/JSGlobalObject.h:
3022 (KJS::JSGlobalObject::pushActivation):
3023 (KJS::JSGlobalObject::checkActivationCount):
3024 (KJS::JSGlobalObject::popActivation):
3027 2008-03-19 Oliver Hunt <oliver@apple.com>
3031 Avoid heap allocating the root scope chain node for eval and closure free functions
3033 Maciej suggested using an inline ScopeChainNode for functions that don't use eval
3034 or closures as they are unable to ever capture the scope chain. This gives us a 2.4%
3035 win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number
3038 * kjs/ExecState.cpp:
3039 (KJS::ExecState::ExecState):
3041 * kjs/scope_chain.h:
3042 (KJS::ScopeChain::push):
3044 2008-03-19 Mark Rowe <mrowe@apple.com>
3046 Reviewed by Sam Weinig.
3050 * kjs/JSGlobalObject.cpp: Add missing #include.
3052 2008-03-19 Sam Weinig <sam@webkit.org>
3054 Reviewed by Anders Carlsson.
3056 Fix for <rdar://problem/5785694>
3057 Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
3059 Make the activeExecStates stack per JSGlobalObject instead of static to ensure
3062 * JavaScriptCore.exp:
3063 * kjs/ExecState.cpp:
3064 (KJS::InterpreterExecState::InterpreterExecState):
3065 (KJS::InterpreterExecState::~InterpreterExecState):
3066 (KJS::EvalExecState::EvalExecState):
3067 (KJS::EvalExecState::~EvalExecState):
3068 (KJS::FunctionExecState::FunctionExecState):
3069 (KJS::FunctionExecState::~FunctionExecState):
3072 * kjs/JSGlobalObject.cpp:
3073 (KJS::JSGlobalObject::mark):
3074 * kjs/JSGlobalObject.h:
3075 (KJS::JSGlobalObject::activeExecStates):
3076 * kjs/collector.cpp:
3077 (KJS::Collector::collect):
3078 (KJS::Collector::reportOutOfMemoryToAllExecStates): Iterate all JSGlobalObjects and report
3079 the OutOfMemory condition to all the ExecStates in each.
3081 2008-03-19 Jasper Bryant-Greene <jasper@unix.geek.nz>
3083 Reviewed by Maciej Stachowiak.
3085 Fix http://bugs.webkit.org/show_bug.cgi?id=17941
3086 Bug 17941: C++-style comments in JavaScriptCore API
3089 Remove C++-style comments from public JavaScriptCore API, replacing
3090 with standard C90 block comments.
3092 2008-03-19 Mark Rowe <mrowe@apple.com>
3094 Reviewed by Oliver Hunt.
3096 Fix http://bugs.webkit.org/show_bug.cgi?id=17939
3097 Bug 17939: Crash decompiling "const a = 1, b;"
3099 * kjs/nodes2string.cpp:
3100 (KJS::ConstDeclNode::streamTo): Null-check the correct variable.
3102 2008-03-18 Oliver Hunt <oliver@apple.com>
3104 Reviewed by Mark Rowe.
3106 Bug 17929: Incorrect decompilation with |const|, comma
3107 http://bugs.webkit.org/show_bug.cgi?id=17929
3109 There were actually two bugs here. First we weren't correctly handling const
3110 nodes with multiple declarations. The second issue was caused by us not
3111 giving the correct precedence to the initialisers.
3113 * kjs/nodes2string.cpp:
3114 (KJS::ConstDeclNode::streamTo):
3116 2008-03-18 Darin Adler <darin@apple.com>
3120 - Speed up JavaScript built-in properties by changing the
3121 hash table to take advantage of the identifier objects
3123 5% speedup for Acid3 test 26
3125 * JavaScriptCore.exp: Updated.
3126 * kjs/create_hash_table: Compute size of hash table large enough so that there
3127 are no collisions, but don't generate the hash table.
3128 * kjs/identifier.h: Made the add function that returns a PassRefPtr public.
3130 (KJS::Lexer::lex): Updated for change to HashTable interface.
3132 (KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for
3133 each property so the equality comparision can be done with pointer comparision.
3134 * kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can
3135 hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed
3136 the Lookup functions to be member functions of HashTable instead.
3138 (KJS::JSObject::deleteProperty): Update for change to HashTable.
3139 (KJS::JSObject::findPropertyHashEntry): Ditto.
3140 (KJS::JSObject::getPropertyAttributes): Ditto.
3141 (KJS::JSObject::getPropertyNames): Ditto.
3143 2008-03-18 Mark Rowe <mrowe@apple.com>
3145 Reviewed by Oliver Hunt.
3147 Fix http://bugs.webkit.org/show_bug.cgi?id=17925 and http://bugs.webkit.org/show_bug.cgi?id=17927.
3148 - Bug 17925: Crash in KJS::JSObject::put after setting this.__proto__
3149 - Bug 17927: Hang after attempting to create circular __proto__
3152 (KJS::JSObject::put): Silently ignore attempts to set __proto__ to a non-object, non-null value.
3153 Return after setting the exception when an attempt to set a cyclic __proto__ is detected so that
3154 the cyclic value is not set.
3156 2008-03-18 Maciej Stachowiak <mjs@apple.com>
3160 - inline ActivationImp::init for 0.8% SunSpider speedup
3163 (KJS::ActivationImp::init): Moved here from function.cpp
3166 2008-03-18 Simon Hausmann <hausmann@webkit.org>
3170 Including config.h like in the other .cpp files gets the #ifdeffery
3173 * kjs/JSWrapperObject.cpp:
3175 2008-03-17 Darin Adler <darin@apple.com>
3179 JavaScriptCore changes to support a WebCore speedup.
3181 * JavaScriptCore.exp: Export the UString::Rep::computeHash function.
3182 * wtf/HashSet.h: Added a find and contains function that take a translator,
3183 like the add function.
3185 2008-03-18 Maciej Stachowiak <mjs@apple.com>
3189 - a few micro-optimizations for 1.2% SunSpider speedup
3192 (KJS::FunctionImp::callAsFunction): check for Return completion before Throw,
3195 (KJS::JSObject::put): When walking prototype chain, instead of
3196 checking isObject (a virtual call), compare to jsNull (compare to
3197 a constant) since null is the only non-object that can be in a
3200 2008-03-17 Oliver Hunt <oliver@apple.com>
3204 Optimise multi-scope function call resolution
3206 Refactor multiscope variable resolution and use to add
3207 optimised FunctionCallResolveNode subclasses.
3209 2.6% gain in sunspider performance, *25%* gain in controlflow-recursive
3212 (KJS::getSymbolTableEntry):
3213 (KJS::ResolveNode::optimizeVariableAccess):
3214 (KJS::getNonLocalSymbol):
3215 (KJS::ExpressionNode::resolveAndCall):
3216 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
3217 (KJS::FunctionCallResolveNode::inlineEvaluate):
3218 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
3219 (KJS::ScopedVarFunctionCallNode::evaluate):
3220 (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
3221 (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
3222 (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
3223 (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
3224 (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
3225 (KJS::NonLocalVarFunctionCallNode::evaluate):
3226 (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
3227 (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
3228 (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
3229 (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
3231 (KJS::ScopedVarFunctionCallNode::):
3232 (KJS::NonLocalVarFunctionCallNode::):
3234 2008-03-17 David Kilzer <ddkilzer@apple.com>
3236 Don't define PLATFORM(MIDDLE_ENDIAN) on little endian ARM.
3240 See <http://bugs.webkit.org/show_bug.cgi?id=15416#c13>.
3242 * wtf/Platform.h: Added check for !defined(__ARMEL__) when defining
3243 PLATFORM(MIDDLE_ENDIAN).
3245 2008-03-17 Oliver Hunt <oliver@apple.com>
3247 Reviewed by Geoff, Darin and Weinig.
3249 Add fast multi-level scope lookup
3251 Add logic and AST nodes to provide rapid variable resolution across
3252 static scope boundaries. This also adds logic that allows us to skip
3253 any static scopes that do not contain the variable to be resolved.
3255 This results in a ~2.5% speedup in SunSpider, and gives a 25-30% speedup
3256 in some simple and ad hoc closure and global variable access tests.
3258 * JavaScriptCore.exp:
3260 * kjs/JSGlobalObject.cpp:
3261 * kjs/JSGlobalObject.h:
3262 * kjs/JSVariableObject.cpp:
3263 * kjs/JSVariableObject.h:
3265 (KJS::ActivationImp::isDynamicScope):
3267 (KJS::ResolveNode::optimizeVariableAccess):
3268 (KJS::ScopedVarAccessNode::inlineEvaluate):
3269 (KJS::ScopedVarAccessNode::evaluate):
3270 (KJS::ScopedVarAccessNode::evaluateToNumber):
3271 (KJS::ScopedVarAccessNode::evaluateToBoolean):
3272 (KJS::ScopedVarAccessNode::evaluateToInt32):
3273 (KJS::ScopedVarAccessNode::evaluateToUInt32):
3274 (KJS::NonLocalVarAccessNode::inlineEvaluate):
3275 (KJS::NonLocalVarAccessNode::evaluate):
3276 (KJS::NonLocalVarAccessNode::evaluateToNumber):
3277 (KJS::NonLocalVarAccessNode::evaluateToBoolean):
3278 (KJS::NonLocalVarAccessNode::evaluateToInt32):
3279 (KJS::NonLocalVarAccessNode::evaluateToUInt32):
3280 (KJS::IfElseNode::optimizeVariableAccess):
3281 (KJS::ScopeNode::optimizeVariableAccess):
3283 (KJS::ScopedVarAccessNode::):
3284 (KJS::NonLocalVarAccessNode::):
3287 2008-03-16 weihongzeng <weihong.zeng@hotmail.com>
3289 Reviewed by Darin Adler.
3291 http://bugs.webkit.org/show_bug.cgi?id=15416
3292 Add support for mixed-endian processors
3294 * kjs/dtoa.cpp: Add IEEE_ARM, triggered by PLATFORM(MIDDLE_ENDIAN).
3296 2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
3298 Rubber stamped by Darin.
3300 Add set-webkit-configuration support for wx port, and centralize
3301 build dir location setting.
3303 http://bugs.webkit.org/show_bug.cgi?id=17790
3307 2008-03-14 Steve Falkenburg <sfalken@apple.com>
3311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3313 2008-03-14 Oliver Hunt <oliver@apple.com>
3317 Add logic to track whether a function uses a locally scoped eval or requires a closure
3319 Now that we limit eval we can track those uses of eval that operate
3320 in the local scope and functions that require a closure. We track
3321 this information during initial parsing to avoid yet another tree
3324 * JavaScriptCore.exp:
3327 (KJS::Parser::didFinishParsing):
3329 (KJS::Parser::parse):
3332 (KJS::ScopeNode::ScopeNode):
3333 (KJS::ProgramNode::ProgramNode):
3334 (KJS::ProgramNode::create):
3335 (KJS::EvalNode::EvalNode):
3336 (KJS::EvalNode::create):
3337 (KJS::FunctionBodyNode::FunctionBodyNode):
3338 (KJS::FunctionBodyNode::create):
3341 (KJS::ScopeNode::usesEval):
3342 (KJS::ScopeNode::needsClosure):
3344 2008-03-14 Geoffrey Garen <ggaren@apple.com>
3346 Reviewed by Beth Dakin.
3348 Fixed another problem with Vector::shrinkCapacity.
3350 moveOverlapping isn't good enough for the case where the buffer hasn't
3351 changed, because it still destroys the contents of the buffer.
3354 (WTF::::shrinkCapacity): Changed to explicitly check whether the call
3355 to allocateBuffer produced a new buffer. If it didn't, there's no need
3358 2008-03-14 Geoffrey Garen <ggaren@apple.com>
3360 Reviewed by Beth Dakin.
3362 Fixed a few problems with Vector::shrinkCapacity that I noticed in testing.
3365 (WTF::VectorBufferBase::deallocateBuffer): Clear our m_buffer pointer
3366 when we deallocate m_buffer, in case we're not asked to reallocate a new
3367 buffer. (Otherwise, we would use a stale m_buffer if we were asked to
3368 perform any operations after shrinkCapacity was called.)
3370 (WTF::VectorBuffer::allocateBuffer): Made VectorBuffer with inline
3371 capacity aware that calls to allocateBuffer might be shrinks, rather
3372 than grows, so we shouldn't allocate a new buffer on the heap unless
3373 our inline buffer is too small.
3375 (WTF::::shrinkCapacity): Call resize() instead of just setting m_size,
3376 so destructors run. Call resize before reallocating the buffer to make
3377 sure that we still have access to the objects we need to destroy. Call
3378 moveOverlapping instead of move, since a call to allocateBuffer on an
3379 inline buffer may produce identical storage.
3381 2008-03-14 Alexey Proskuryakov <ap@webkit.org>
3385 Get rid of a localime() call on platforms that have better alternatives.
3387 * kjs/DateMath.h: Added getLocalTime();
3390 (KJS::getLocalTime):
3391 (KJS::getDSTOffsetSimple):
3392 Implementation moved from getDSTOffsetSimple().
3394 * kjs/date_object.cpp:
3395 (KJS::DateObjectImp::callAsFunction): Switched to getLocalTime().
3397 2008-03-14 David D. Kilzer <ddkilzer@apple.com>
3399 Unify concept of enabling the Mac Java bridge.
3401 Reviewed by Darin and Anders.
3403 * wtf/Platform.h: Define ENABLE_MAC_JAVA_BRIDGE here.
3405 2008-03-13 Mark Mentovai <mark@moxienet.com>
3407 Reviewed by eseidel. Landed by eseidel.
3409 * wtf/FastMalloc.cpp: #include <wtf/HashSet.h> outside of any
3412 2008-03-13 Mark Mentovai <mark@moxienet.com>
3414 Reviewed by eseidel. Landed by eseidel.
3416 * pcre/pcre_exec.cpp: Fix misnamed variable, allowing -DDEBUG build
3418 * wtf/ThreadingPthreads.cpp: #include <sys/time.h> for gettimeofday
3421 2008-03-13 Steve Falkenburg <sfalken@apple.com>
3425 Disable PGO for normal release builds.
3426 Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
3428 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3430 2008-03-13 Beth Dakin <bdakin@apple.com>
3434 Adding new functionality to Vector. Currently all of the shrink and
3435 resize functions on Vector only shrink the size of the Vector, not
3436 the capacity. For the Vector to take up as little memory as
3437 possible, though, it is necessary to be able to shrink the capacity
3438 as well. So this patch adds that functionality.
3440 I need this for a speed up I am working on, and Geoff wants to use
3441 it in a speed up he is working on also, so he asked me to commit it
3445 (WTF::VectorBufferBase::allocateBuffer):
3446 (WTF::::shrinkCapacity):
3448 2008-03-13 Simon Hausmann <hausmann@webkit.org>
3450 Reviewed by Adam Roben.
3452 Attempt at fixing the Qt/Windows build bot. Quote using double-quotes
3453 instead of single quotes.
3457 2008-03-12 Steve Falkenburg <sfalken@apple.com>
3461 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3463 2008-03-12 Alp Toker <alp@atoker.com>
3465 Another autotools testkjs build fix attempt.
3469 2008-03-12 Alp Toker <alp@atoker.com>
3471 Attempt to fix the autotools testkjs build on systems with
3472 non-standard include paths.
3476 2008-03-11 Alexey Proskuryakov <ap@webkit.org>
3480 <rdar://problem/5787743> REGRESSION: Crash at WTF::Collator::CreateCollator() running fast/js/kde/StringObject.html on Windows
3482 * wtf/unicode/icu/CollatorICU.cpp:
3483 (WTF::Collator::createCollator): Check for null (== user default) m_locale before calling strcmp.
3485 2008-03-11 Steve Falkenburg <sfalken@apple.com>
3487 Disable LTCG/PGO for grammar.cpp and nodes.cpp.
3488 PGO on these files causes us to hang.
3490 Copy newer vsprops files from relative WebKitLibraries path to environment variable based path.
3494 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3495 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3497 2008-03-10 Darin Adler <darin@apple.com>
3501 * kjs/function.cpp: (KJS::decode): Initialize variable.
3503 2008-03-10 Brent Fulgham <bfulgham@gmail.com>
3509 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3510 Set the PATH to include Cygwin before running touch.
3512 2008-03-10 Eric Seidel <eric@webkit.org>
3514 Build fix for JSC on windows.
3516 * API/JSStringRefCF.cpp:
3517 (JSStringCreateWithCFString):
3520 * kjs/nodes2string.cpp:
3521 (KJS::escapeStringForPrettyPrinting):
3523 2008-03-10 Eric Seidel <eric@webkit.org>
3525 No review, build fix only.
3527 Attempt to fix the windows build?
3529 * kjs/ustring.h: change unsigned short to UChar
3531 2008-03-10 Eric Seidel <eric@webkit.org>
3535 Remove KJS::UChar, use ::UChar instead
3536 http://bugs.webkit.org/show_bug.cgi?id=17017
3538 * API/JSStringRef.cpp:
3539 (JSStringCreateWithCharacters):
3540 (JSStringCreateWithUTF8CString):
3541 * API/JSStringRefCF.cpp:
3542 (JSStringCreateWithCFString):
3543 * JavaScriptCore.exp:
3549 (KJS::globalFuncEscape):
3550 (KJS::globalFuncUnescape):
3551 * kjs/function_object.cpp:
3552 (KJS::FunctionObjectImp::construct):
3553 * kjs/identifier.cpp:
3554 (KJS::Identifier::equal):
3555 (KJS::CStringTranslator::translate):
3556 * kjs/interpreter.h:
3558 (KJS::Lexer::setCode):
3559 (KJS::Lexer::shift):
3561 (KJS::Lexer::convertUnicode):
3562 (KJS::Lexer::makeIdentifier):
3565 * kjs/nodes2string.cpp:
3566 (KJS::escapeStringForPrettyPrinting):
3567 (KJS::SourceStream::operator<<):
3569 (KJS::RegExp::RegExp):
3570 (KJS::RegExp::match):
3571 * kjs/string_object.cpp:
3572 (KJS::substituteBackreferences):
3573 (KJS::stringProtoFuncCharCodeAt):
3574 (KJS::stringProtoFuncToLowerCase):
3575 (KJS::stringProtoFuncToUpperCase):
3576 (KJS::stringProtoFuncToLocaleLowerCase):
3577 (KJS::stringProtoFuncToLocaleUpperCase):
3579 (KJS::UString::Rep::computeHash):
3580 (KJS::UString::UString):
3581 (KJS::UString::append):
3582 (KJS::UString::ascii):
3583 (KJS::UString::operator=):
3584 (KJS::UString::is8Bit):
3585 (KJS::UString::toStrictUInt32):
3586 (KJS::UString::find):
3590 (KJS::UString::UTF8String):
3594 2008-03-09 Steve Falkenburg <sfalken@apple.com>
3596 Stop Windows build if an error occurs in a prior project.
3598 Rubber stamped by Darin.
3600 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3601 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3602 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3603 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3605 2008-03-09 J¸rg Billeter <j@bitron.ch>
3607 Reviewed by Alp Toker.
3609 Conditionalise ICU for Unicode in the GTK+ port.
3613 2008-03-07 David D. Kilzer <ddkilzer@apple.com>
3615 Unify concept of enabling Netscape Plug-in API (NPAPI).
3619 * wtf/Platform.h: Define ENABLE_NETSCAPE_PLUGIN_API here.
3621 2008-03-07 Geoffrey Garen <ggaren@apple.com>
3623 Reviewed by Darin Adler.
3625 Fixed <rdar://problem/5689093> Stricter (ES4) eval semantics
3629 - "eval(s)" is treated as an operator that gives the ES3 eval behavior.
3630 ... but only if there is no overriding declaration of "eval" in scope.
3631 - All other invocations treat eval as a function that evaluates a
3632 script in the context of its "this" object.
3633 ... but if its "this" object is not the global object it was
3634 originally associated with, eval throws an exception.
3636 Because only expressions of the form "eval(s)" have access to local
3637 scope, the compiler can now statically determine whether a function
3638 needs local scope to be dynamic.
3640 * kjs/nodes.h: Added FunctionCallEvalNode. It works just like
3641 FuncationCallResolveNode, except it statically indicates that the node
3642 may execute eval in the ES3 way.
3644 * kjs/nodes2string.cpp:
3646 * tests/mozilla/expected.html: This patch happens to fix a Mozilla JS
3647 test, but it's a bit of a pyrrhic victory. The test intends to test
3648 Mozilla's generic API for calling eval on any object, but, in reality,
3649 we only support calling eval on the global object.
3651 2008-03-06 Steve Falkenburg <sfalken@apple.com>
3655 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3657 2008-03-06 Steve Falkenburg <sfalken@apple.com>
3661 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3663 2008-03-06 Alp Toker <alp@atoker.com>
3665 Fix the build fix in r30845 to support out-of-tree builds.
3669 2008-03-06 Steve Falkenburg <sfalken@apple.com>
3673 * wtf/ThreadingWin.cpp:
3674 (WTF::ThreadCondition::timedWait):
3676 2008-03-06 Darin Adler <darin@apple.com>
3678 - another small step towards fixing the Qt build
3680 * JavaScriptCore.pri: Remove more references to the now-obsolete bindings directory.
3682 2008-03-06 Darin Adler <darin@apple.com>
3684 - a small step towards fixing the Qt build
3686 * JavaScriptCore.pri: Remove references to files no longer present in JavaScriptCore/bindings.
3688 2008-03-06 Brady Eidson <beidson@apple.com>
3692 * wtf/ThreadingGtk.cpp:
3693 (WTF::ThreadCondition::timedWait):
3695 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
3699 * wtf/unicode/icu/CollatorICU.cpp:
3700 (WTF::Collator::userDefault): Put ICU workaround under both PLATFORM(DARWIN) and
3701 PLATFORM(CF) checks, so that each port can decide if it wants to use CF on Mac for it.
3703 2008-03-06 Brady Eidson <beidson@apple.com>
3707 Add a timedWait() method to ThreadCondition
3709 * JavaScriptCore.exp:
3713 * wtf/ThreadingGtk.cpp:
3714 (WTF::ThreadCondition::timedWait):
3716 * wtf/ThreadingNone.cpp:
3717 (WTF::ThreadCondition::timedWait):
3719 * wtf/ThreadingPthreads.cpp:
3720 (WTF::ThreadCondition::timedWait):
3722 * wtf/ThreadingWin.cpp:
3723 (WTF::ThreadCondition::timedWait): Needs implementation
3725 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
3729 * jscore.bkl: Add the wtf/unicode directory.
3730 * wtf/unicode/CollatorDefault.cpp:
3731 (WTF::Collator::userDefault): Use a constructor that does exist.
3732 * wtf/unicode/icu/CollatorICU.cpp: Mac build fix for case-sensitive file systems.
3734 2008-03-06 Darin Adler <darin@apple.com>
3736 - try to fix the Qt build
3738 * JavaScriptCore.pri: Add the wtf/unicode directory.
3740 2008-03-06 Darin Adler <darin@apple.com>
3742 - try to fix the GTK build
3744 * GNUmakefile.am: Add a -I for the wtf/unicode directory.
3746 2008-03-06 Darin Adler <darin@apple.com>
3748 - try to fix the Mac build
3750 * icu/unicode/parseerr.h: Copied from ../WebCore/icu/unicode/parseerr.h.
3751 * icu/unicode/ucol.h: Copied from ../WebCore/icu/unicode/ucol.h.
3752 * icu/unicode/uloc.h: Copied from ../WebCore/icu/unicode/uloc.h.
3753 * icu/unicode/unorm.h: Copied from ../WebCore/icu/unicode/unorm.h.
3754 * icu/unicode/uset.h: Copied from ../WebCore/icu/unicode/uset.h.
3756 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
3760 <rdar://problem/5687269> Need to create a Collator abstraction for WebCore and JavaScriptCore
3763 (WTF::initializeThreading):
3764 * wtf/ThreadingGtk.cpp:
3765 (WTF::initializeThreading):
3766 * wtf/ThreadingNone.cpp:
3767 * wtf/ThreadingPthreads.cpp:
3768 * wtf/ThreadingWin.cpp:
3769 Added AtomicallyInitializedStatic.
3771 * kjs/string_object.cpp: (KJS::localeCompare): Changed to use Collator.
3774 * JavaScriptCore.exp:
3775 * JavaScriptCore.pri:
3776 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3777 * JavaScriptCore.xcodeproj/project.pbxproj:
3778 * JavaScriptCoreSources.bkl:
3779 Added new fiiles to projects.
3781 * wtf/unicode/Collator.h: Added.
3783 * wtf/unicode/CollatorDefault.cpp: Added.
3784 (WTF::Collator::Collator):
3785 (WTF::Collator::~Collator):
3786 (WTF::Collator::setOrderLowerFirst):
3787 (WTF::Collator::collate):
3788 * wtf/unicode/icu/CollatorICU.cpp: Added.
3789 (WTF::cachedCollatorMutex):
3790 (WTF::Collator::Collator):
3791 (WTF::Collator::~Collator):
3792 (WTF::Collator::setOrderLowerFirst):
3793 (WTF::Collator::collate):
3794 (WTF::Collator::createCollator):
3795 (WTF::Collator::releaseCollator):
3797 2008-03-05 Kevin Ollivier <kevino@theolliviers.com>
3799 Fix the wx build after the bindings move.
3801 * JavaScriptCoreSources.bkl:
3804 2008-03-05 Alp Toker <alp@atoker.com>
3806 GTK+ build fix for breakage introduced in r30800.
3808 Track moved bridge sources from JavaScriptCore to WebCore.
3812 2008-03-05 Brent Fulgham <bfulgham@gmail.com>
3814 Reviewed by Adam Roben.
3816 Remove definition of WTF_USE_SAFARI_THEME from wtf/Platform.h
3817 because the PLATFORM(CG) flag is not set until config.h has
3818 already included this file.
3820 * wtf/Platform.h: Remove useless definition of WTF_USE_SAFARI_THEME
3822 2008-03-05 Brady Eidson <beidson@apple.com>
3824 Reviewed by Alexey and Mark Rowe
3826 Fix for <rdar://problem/5778247> - Reproducible crash on storage/execute-sql-args.html
3828 DatabaseThread::unscheduleDatabaseTasks() manually filters through a MessageQueue,
3829 removing particular items for Databases that were shutting down.
3831 This filtering operation is not atomic, and therefore causes a race condition with the
3832 MessageQueue waking up and reading from the message queue.
3834 The end result was an attempt to dereference a null DatabaseTask. Timing-wise, this never
3835 seemed to happen in a debug build, otherwise an assertion would've caught it. Replacing that
3836 assertion with a crash in a release build is what revealed this bug.
3838 * wtf/MessageQueue.h:
3839 (WTF::::waitForMessage): Tweak the waiting logic to check the queue's empty state then go back
3840 to sleep if the queue was empty - checking m_killed each time it wakes up.
3842 2008-03-05 David D. Kilzer <ddkilzer@apple.com>
3844 Remove unused header includes from interpreter.cpp.
3848 * kjs/interpreter.cpp: Remove unused header includes.
3850 2008-03-05 Anders Carlsson <andersca@apple.com>
3856 * bindings: Removed.
3858 2008-03-05 Anders Carlsson <andersca@apple.com>
3860 Don't build bindings/ anymore.
3862 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3864 2008-03-05 Anders Carlsson <andersca@apple.com>
3868 Don't build JavaScriptCore/bindings.
3870 * JavaScriptCore.exp:
3871 Export a couple of new functions.
3873 * JavaScriptCore.xcodeproj/project.pbxproj:
3877 No need to define HAVE_JNI anymore.
3879 * kjs/interpreter.cpp:
3880 Remove unnecessary include.
3882 2008-03-05 David D. Kilzer <ddkilzer@apple.com>
3884 Allow override of default script file name using command-line argument.
3889 (main): Allow first command-line argument to override the default script
3890 file name of "minidom.js".
3892 (main): Allow first command-line argument to override the default script
3893 file name of "testapi.js".
3895 2008-03-04 Mark Rowe <mrowe@apple.com>
3899 * JavaScriptCore.exp: Add new symbol to exports file.
3901 2008-03-03 Oliver Hunt <oliver@apple.com>
3905 Make ForInNode check for the timeout interrupt
3908 (KJS::ForInNode::execute):
3910 2008-03-02 Brent Fulgham <bfulgham@gmail.com>
3912 Reviewed by Alp Toker.
3914 http://bugs.webkit.org/show_bug.cgi?id=17415
3915 GTK Build (using autotools) on Mac OS (DarwinPorts) Fails
3917 Add -lstdc++ to link flags for minidom program. This corrects
3918 a build error for the GTK+ on Mac OS.
3922 2008-03-01 Mark Rowe <mrowe@apple.com>
3924 Reviewed by Tim Hatcher.
3926 Update Xcode configuration to support building debug and release from the mysterious future.
3928 * Configurations/Base.xcconfig:
3929 * Configurations/DebugRelease.xcconfig:
3931 2008-02-29 Brent Fulgham <bfulgham@gmail.com>
3933 http://bugs.webkit.org/show_bug.cgi?id=17483
3934 Implement scrollbars on Windows (Cairo)
3936 Reviewed by Adam Roben.
3940 2008-02-29 Adam Roben <aroben@apple.com>
3942 Remove unused DebuggerImp::abort and DebuggerImp::aborted
3944 Reviewed by Tim and Sam.
3946 * kjs/function_object.cpp:
3947 (KJS::FunctionObjectImp::construct):
3949 (KJS::DebuggerImp::DebuggerImp):
3951 (KJS::Node::handleException):
3952 (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
3954 2008-02-28 Eric Christopher <echristo@apple.com>
3956 Reviewed by Geoffrey Garen.
3958 ** TOTAL **: 1.005x as fast 2867.6ms +/- 0.4% 2853.2ms +/- 0.3% significant
3960 * kjs/nodes.cpp: Tell the compiler that exceptions are unexpected (for
3961 the sake of branch prediction and code organization).
3963 2008-02-27 Alexey Proskuryakov <ap@webkit.org>
3965 Reviewed by Sam Weinig.
3967 http://bugs.webkit.org/show_bug.cgi?id=17030
3968 Small buffer overflow within initialization
3970 * kjs/date_object.cpp:
3971 (KJS::DateObjectFuncImp::callAsFunction):
3973 Remove unnecessary and incorrect memset() calls - GregorianDateTime can initialize itself.
3975 2008-02-25 Sam Weinig <sam@webkit.org>
3977 Reviewed by Dan Bernstein.
3979 - Add a variant of remove that takes a position and a length.
3982 (WTF::Vector::remove):
3984 2008-02-25 Mark Mentovai <mark@moxienet.com>
3986 Reviewed by Mark Rowe.
3988 Enable CollectorHeapIntrospector to build by itself, as well as in an AllInOneFile build.
3989 http://bugs.webkit.org/show_bug.cgi?id=17538
3991 * kjs/CollectorHeapIntrospector.cpp: Provide "using" declaration for
3992 WTF::RemoteMemoryReader.
3993 * kjs/collector.h: Move CollectorHeap declaration here...
3994 * kjs/collector.cpp: ... from here.
3996 2008-02-25 Darin Adler <darin@apple.com>
4000 * JavaScriptCore.exp: Sort the contents of this file.
4002 2008-02-25 Adam Roben <aroben@apple.com>
4007 (functionQuit): Don't add a return statement after exit(0) for MSVC.
4009 2008-02-24 Sam Weinig <sam@webkit.org>
4011 Reviewed by Mark Rowe.
4013 http://bugs.webkit.org/show_bug.cgi?id=17529
4014 Add support for reading from stdin from testkjs
4017 (GlobalObject::GlobalObject): Add readline function to global object.
4018 (functionReadline): Added. Reads characters from stdin until a '\n' or
4019 EOF is encountered. The input is returned as a String to the caller.
4021 2008-02-24 Sam Weinig <sam@webkit.org>
4023 Reviewed by Mark Rowe.
4025 http://bugs.webkit.org/show_bug.cgi?id=17528
4028 * JavaScriptCore.exp:
4029 * JavaScriptCore.xcodeproj/project.pbxproj: Make the testkjs.cpp use 4 space indentation.
4031 (StopWatch::getElapsedMS):
4032 (GlobalObject::className):
4033 (GlobalObject::GlobalObject):
4034 Rename GlobalImp to GlobalObject and setup the global functions
4035 in the GlobalObject's constructor. Also, use static functions for
4036 the implementation so we can use the standard PrototypeFunction
4037 class and remove TestFunctionImp.
4038 (functionPrint): Move print() functionality here.
4039 (functionDebug): Move debug() functionality here.
4040 (functionGC): Move gc() functionality here.
4041 (functionVersion): Move version() functionality here.
4042 (functionRun): Move run() functionality here.
4043 (functionLoad): Move load() functionality here.
4044 (functionQuit): Move quit() functionality here.
4045 (prettyPrintScript): Fix indentation.
4046 (runWithScripts): Since all the functionality of createGlobalObject is
4047 now in the GlobalObject constructor, just call new here.
4048 (parseArguments): Fix indentation.
4050 (fillBufferWithContentsOfFile): Ditto.
4052 2008-02-24 Sam Weinig <sam@webkit.org>
4054 Reviewed by Oliver Hunt and Mark Rowe.
4056 http://bugs.webkit.org/show_bug.cgi?id=17505
4057 Add support for getting command line arguments in testkjs
4059 - This slightly changes the behavior of parsing arguments by requiring
4060 a '-f' before all files.
4063 (createGlobalObject): Add a global property called 'arguments' which
4064 contains an array with the parsed arguments as strings.
4065 (runWithScripts): Pass in the arguments vector so that it can be passed
4066 to the global object.
4067 (parseArguments): Change parsing rules to require a '-f' before any script
4068 file. After all '-f' and '-p' arguments have been parsed, the remaining
4069 are added to the arguments vector and exposed to the script. If there is a
4070 chance of ambiguity (the user wants to pass the string '-f' to the script),
4071 the string '--' can be used separate the options from the pass through
4075 2008-02-24 Dan Bernstein <mitz@apple.com>
4077 Reviewed by Darin Adler.
4079 - fix http://bugs.webkit.org/show_bug.cgi?id=17511
4080 REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
4083 (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
4084 are both zero but the buffer capacity is non-zero.
4085 (WTF::::prepend): Added validity checks.
4087 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
4089 Rubber stamped by Darin.
4091 Add separator '\' after libJavaScriptCore_la_LIBADD and cleanup
4092 whitespaces introduced in the previous commit.
4096 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
4098 * GNUmakefile.am: Add GLOBALDEPS for testkjs and minidom.
4100 2008-02-23 Darin Adler <darin@apple.com>
4104 - http://bugs.webkit.org/show_bug.cgi?id=17496
4105 make Deque use a circular array; add iterators
4107 * wtf/Deque.h: Wrote an all-new version of this class that uses a circular
4108 buffer. Growth policy is identical to vector. Added iterators.
4110 * wtf/Vector.h: Made two small refinements while using this to implement
4111 Deque: Made VectorBufferBase derive from Noncopyable, which would have
4112 saved me some debugging time if it had been there. Renamed Impl and
4113 m_impl to Buffer and m_buffer.
4115 2008-02-23 Darin Adler <darin@apple.com>
4119 - http://bugs.webkit.org/show_bug.cgi?id=17067
4120 eliminate attributes parameter from JSObject::put for speed/clarity
4122 * API/JSCallbackObject.h: Removed attribute arguments.
4123 * API/JSCallbackObjectFunctions.h:
4124 (KJS::JSCallbackObject<Base>::put): Ditto.
4125 * API/JSObjectRef.cpp:
4126 (JSObjectSetProperty): Use initializeVariable or putDirect when necessary
4127 to set attribute values.
4128 * JavaScriptCore.exp: Updated.
4129 * bindings/objc/objc_runtime.h: Removed attribute arguments.
4130 * bindings/objc/objc_runtime.mm:
4131 (ObjcFallbackObjectImp::put): Ditto.
4132 * bindings/runtime_array.cpp:
4133 (RuntimeArray::put): Ditto.
4134 * bindings/runtime_array.h: Ditto.
4135 * bindings/runtime_object.cpp:
4136 (RuntimeObjectImp::put): Ditto.
4137 * bindings/runtime_object.h: Ditto. Also removed canPut which was only
4138 called from one place in WebCore that can use hasProperty instead.
4140 * kjs/Activation.h: Removed attribute argument from put and added the new
4141 initializeVariable function that's used to put variables in variable objects.
4142 Also made isActivationObject a const member.
4144 * kjs/JSGlobalObject.cpp:
4145 (KJS::JSGlobalObject::put): Removed attribute argument.
4146 (KJS::JSGlobalObject::initializeVariable): Added. Used to give variables
4147 their initial values, which can include the read-only property.
4148 (KJS::JSGlobalObject::reset): Removed obsolete comments about flags.
4149 Removed Internal flag, which is no longer needed.
4150 * kjs/JSGlobalObject.h: More of the same.
4152 * kjs/JSVariableObject.h: Added pure virtual initializeVariable function.
4153 (KJS::JSVariableObject::symbolTablePut): Removed checkReadOnly flag; we always
4155 (KJS::JSVariableObject::symbolTableInitializeVariable): Added.
4157 * kjs/array_instance.cpp:
4158 (KJS::ArrayInstance::put): Removed attribute argument.
4159 * kjs/array_instance.h: Ditto.
4162 (KJS::FunctionImp::put): Ditto.
4163 (KJS::Arguments::put): Ditto.
4164 (KJS::ActivationImp::put): Ditto.
4165 (KJS::ActivationImp::initializeVariable): Added.
4166 * kjs/function.h: Removed attribute arguments.
4168 * kjs/function_object.cpp:
4169 (KJS::FunctionObjectImp::construct): Removed Internal flag.
4172 (KJS::lookupPut): Removed attributes argument. Also changed to use putDirect
4173 instead of calling JSObject::put.
4174 (KJS::cacheGlobalObject): Ditto.
4177 (KJS::ConstDeclNode::handleSlowCase): Call initializeVariable to initialize
4179 (KJS::ConstDeclNode::evaluateSingle): Ditto.
4180 (KJS::TryNode::execute): Use putDirect to set up the new object.
4181 (KJS::FunctionBodyNode::processDeclarations): Removed Internal.
4182 (KJS::ProgramNode::processDeclarations): Ditto.
4183 (KJS::EvalNode::processDeclarations): Call initializeVariable to initialize