1 2013-01-17 David Kilzer <ddkilzer@apple.com>
3 Fix vprintf_stderr_common() to compile with -Wshorten-64-to-32
4 <http://webkit.org/b/107126>
6 Reviewed by Darin Adler.
8 Fixes the following build error:
10 Assertions.cpp:92:22: error: implicit conversion loses integer precision: 'CFIndex' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
11 int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
12 ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 (vprintf_stderr_common): Use CFIndex type instead of int for the
17 return value of CFStringGetMaximumSizeForEncoding().
19 2013-01-17 Zan Dobersek <zdobersek@igalia.com>
21 [Autotools] Unify WTF sources list regardless of the target OS, Unicode backend
22 https://bugs.webkit.org/show_bug.cgi?id=105886
24 Reviewed by Gustavo Noronha Silva.
26 Rather than including files in the sources list in an OS-specific way,
27 guard specific files with OS(UNIX|WINDOWS), USE((GLIB|ICU)_UNICODE) guards
28 and include all of them in the list.
30 Proper comments for namespace and #if guard closings are also added or adjusted
31 where necessary in the affected files.
33 * GNUmakefile.list.am:
34 * wtf/OSAllocatorPosix.cpp: Add OS(UNIX) guards.
35 * wtf/OSAllocatorWin.cpp: Add OS(WINDOWS) guards.
36 * wtf/ThreadSpecificWin.cpp: Ditto.
37 * wtf/ThreadingWin.cpp: Ditto.
38 * wtf/unicode/glib/UnicodeGLib.cpp: Add USE(GLIB_UNICODE) guards.
40 * wtf/unicode/glib/UnicodeGLib.h: Ditto.
42 * wtf/unicode/icu/CollatorICU.cpp: Style changes.
43 * wtf/unicode/icu/UnicodeIcu.h: Add USE(ICU_UNICODE) guards.
45 * wtf/win/OwnPtrWin.cpp: Add OS(WINDOWS) guards.
47 2013-01-16 Benjamin Poulain <benjamin@webkit.org>
49 Use GCC's implementation of atomicIncrement/Decrement on Mac
50 https://bugs.webkit.org/show_bug.cgi?id=106976
52 Reviewed by Filip Pizlo.
55 GCC and LLVM have builtin for atomic ADD and SUB: __sync_add_and_fetch,
58 Using them let the compiler just generate the atomic operations inline
59 instead of generating a function call to LibC. It also simplify the
62 2013-01-15 Adam Barth <abarth@webkit.org>
64 Generalize DocumentWeakReference into WTF::WeakPtr
65 https://bugs.webkit.org/show_bug.cgi?id=106854
67 Reviewed by Darin Adler.
69 This patch adds a simple WeakPtr object to WTF. To use WeakPtr, objects
70 must hold a WeakPtrFactory member variable, which clears the WeakPtrs
71 when the object is destructed. The underlying storage is a
72 ThreadSafeRefCounted "WeakReference" object, which is shared by all the
75 WeakPtr is a generalization of DocumentWeakReference, which is used to
76 check whether the Document object is alive when tasks arive on the main
77 thread from worker threads. We plan to use a similar pattern in the
78 threaded HTML parser, but we want to send tasks to objects other than
81 * GNUmakefile.list.am:
84 * WTF.vcproj/WTF.vcproj:
85 * WTF.xcodeproj/project.pbxproj:
87 * wtf/WeakPtr.h: Added.
89 - The ThreadSafeRefCounted object shared by all the WeakPtr
90 instances. This patch uses ThreadSafeRefCounted so that we can
91 use WeakPtrs to cancel cross-thread messages.
92 (WTF::WeakReference::create):
93 (WTF::WeakReference::get):
94 (WTF::WeakReference::clear):
95 - When the object is destroyed, WeakPtrFactory calls this function
96 to clear all the WeakPtrs.
97 (WTF::WeakReference::WeakReference):
98 (WTF::WeakPtr::WeakPtr):
100 - We might want to add implicit conversions and Boolean operators
101 in the future, but I've kept this class simple for now.
102 (WTF::WeakPtrFactory::WeakPtrFactory):
103 (WTF::WeakPtrFactory::~WeakPtrFactory):
104 (WTF::WeakPtrFactory::createWeakPtr):
106 2013-01-12 Csaba Osztrogonác <ossy@webkit.org>
108 Use __sync_add_and_fetch instead of __gnu_cxx::__exchange_and_add
109 https://bugs.webkit.org/show_bug.cgi?id=106729
111 After r139514 we need atomicIncrement(int64_t volatile*) for all platform. Now the
112 GCC implementation of atomicIncrement() is based on __gnu_cxx::__exchange_and_add,
113 which doesn't support int64_t type, but __sync_add_and_fetch does.
115 Reviewed by Benjamin Poulain.
118 (WTF::atomicIncrement):
119 (WTF::atomicDecrement):
121 2013-01-11 Filip Pizlo <fpizlo@apple.com>
123 Add WTF_EXPORT_PRIVATE to printInternal() methods of PrintStream.h
125 Rubber stamped by Mark Hahnenberg.
127 This will make it easier to use dataLog() from WebCore.
132 2013-01-09 Antti Koivisto <antti@apple.com>
134 Release FastMalloc thread caches on memory warning
135 https://bugs.webkit.org/show_bug.cgi?id=106471
137 Reviewed by Geoff Garen.
139 Use TCMalloc_ThreadCache::Cleanup() instead of calling Scavenge() twice. This releases all the memory
142 * wtf/FastMalloc.cpp:
143 (WTF::releaseFastMallocFreeMemory):
145 2013-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
147 Unreviewed. Fix make distcheck.
149 * GNUmakefile.list.am: Add missing header.
151 2013-01-07 Filip Pizlo <fpizlo@apple.com>
153 Rationalize closure call heuristics and profiling
154 https://bugs.webkit.org/show_bug.cgi?id=106270
156 Reviewed by Oliver Hunt.
158 Add a macro to add a method to a class that returns a dumper. Allows you to have
159 secondary dump() methods for dumping either more or less information.
164 2013-01-07 Ryosuke Niwa <rniwa@webkit.org>
166 Sorted the xcodeproj file.
168 * WTF.xcodeproj/project.pbxproj:
170 2013-01-07 Filip Pizlo <fpizlo@apple.com>
172 Unreviewed, it should be possible to build JSC on ARM.
174 * wtf/FastMalloc.cpp:
175 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
177 2013-01-07 Balazs Kilvady <kilvadyb@homejinni.com>
179 MIPS LLInt implementation.
180 https://bugs.webkit.org/show_bug.cgi?id=99706
182 Reviewed by Filip Pizlo.
184 LLInt implementation for MIPS.
188 2013-01-05 Jonathan Liu <net147@gmail.com>
190 Only enable MinGW-w64 pow() workaround if needed
191 https://bugs.webkit.org/show_bug.cgi?id=106099
193 Reviewed by Filip Pizlo.
195 The pow() workaround is no longer needed in the latest version
200 2013-01-05 Jonathan Liu <net147@gmail.com>
202 Fix compilation of MathExtras.h with MinGW-w64
203 https://bugs.webkit.org/show_bug.cgi?id=106105
205 Reviewed by Simon Hausmann.
207 The isfinite and isinf functions are required by wtf_pow but
208 not defined until after wtf_pow. Move wtf_pow to after
209 "using std::isfinite" and "using std::isinf" to fix compilation.
214 2013-01-03 Filip Pizlo <fpizlo@apple.com>
216 CallLinkStatus should be aware of closure calls, and the DFG bytecode parser should use that as its sole internal notion of how to optimize calls
217 https://bugs.webkit.org/show_bug.cgi?id=106027
219 Reviewed by Mark Hahnenberg.
221 I got tired of the various idioms for printing a list of things with comma in between, so I wrote a helper.
223 * WTF.xcodeproj/project.pbxproj:
224 * wtf/CommaPrinter.h: Added.
227 (WTF::CommaPrinter::CommaPrinter):
228 (WTF::CommaPrinter::dump):
230 2013-01-02 Simon Hausmann <simon.hausmann@digia.com>
232 [MinGW-w64] Centralize workaround for pow() implementation
233 https://bugs.webkit.org/show_bug.cgi?id=105925
235 Reviewed by Sam Weinig.
237 As suggested by Sam, move the MinGW-w64 workaround into MathExtras.h
238 away from the JSC usage.
243 2013-01-02 Adam Barth <abarth@webkit.org>
245 WTF.gypi lists Platform.h twice
246 https://bugs.webkit.org/show_bug.cgi?id=105731
248 Reviewed by Tony Chang.
250 Once ought to be enough for everybody.
254 2012-12-31 Gavin Barraclough <barraclough@apple.com>
256 Objective-C API for JavaScriptCore
257 https://bugs.webkit.org/show_bug.cgi?id=105889
259 Reviewed by Filip Pizlo.
261 * wtf/WTFThreadData.cpp:
262 (WTF::WTFThreadData::WTFThreadData):
263 * wtf/WTFThreadData.h:
265 - Added m_apiData - provide convenient storage for use by the API.
267 2012-12-28 Ilya Tikhonovsky <loislo@chromium.org>
269 Web Inspector: Native Memory Instrumentation: instrument not instrumented members.
270 https://bugs.webkit.org/show_bug.cgi?id=105830
272 Reviewed by Vsevolod Vlasov.
274 In some cases we don't want to visit some class members.
275 As example we decided to skip pointers to interface classes such as GraphicLayerClient.
276 We could use addWeakPointer for them but it can't be used for nonpointer members.
277 In the offline discussion we came to a conclusion that we need a new instrumentation
278 method ignoreMember, which will be used for all the members which we won't like to visit/instrument.
280 DriveBy: Also I instrumented not yet instrumented members.
282 * wtf/MemoryInstrumentation.h:
284 (WTF::MemoryClassInfo::ignoreMember):
286 2012-12-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
288 Fix build warning in OSAllocatorPosix.cpp
289 https://bugs.webkit.org/show_bug.cgi?id=105761
291 Reviewed by Kentaro Hara.
293 * wtf/OSAllocatorPosix.cpp:
294 (WTF::OSAllocator::reserveUncommitted): Fix unused param warnings.
296 2012-12-24 Yury Semikhatsky <yurys@chromium.org>
298 Memory instrumentation: provide a way to mark a node as a root
299 https://bugs.webkit.org/show_bug.cgi?id=105737
301 Reviewed by Alexander Pavlov.
303 Objects added using MemoryInstrumentation::addRootObject will be marked as roots.
305 * wtf/MemoryInstrumentation.cpp:
306 (WTF::MemoryInstrumentation::WrapperBase::process):
308 (WTF::MemoryInstrumentation::WrapperBase::processPointer):
309 (WTF::MemoryInstrumentation::WrapperBase::processRootObjectRef):
310 * wtf/MemoryInstrumentation.h:
312 * wtf/MemoryObjectInfo.h: added root marker which can be used by the heap graph builder.
313 (WTF::MemoryObjectInfo::MemoryObjectInfo):
314 (WTF::MemoryObjectInfo::isRoot):
315 (WTF::MemoryObjectInfo::markAsRoot):
318 2012-12-24 Ilya Tikhonovsky <loislo@chromium.org>
320 Web Inspector: Native Memory Instrumentation: propagate member type as edge type to the serialized heap graph.
321 https://bugs.webkit.org/show_bug.cgi?id=105725
323 Reviewed by Yury Semikhatsky.
325 MemoryOwningType was renamed to MemberType.
326 Source argument were removed from reportEdge, reportLeaf and other edge related methods because it is not necessary.
327 MemberType argument was propagated from MemoryInstrumentation down to HeapGraphSerializer.
329 The changes covered by tests in TestWebKitAPI.
331 * wtf/MemoryInstrumentation.cpp:
332 (WTF::MemoryInstrumentation::reportEdge):
333 (WTF::MemoryInstrumentation::reportLinkToBuffer):
334 (WTF::MemoryClassInfo::addPrivateBuffer):
335 * wtf/MemoryInstrumentation.h:
336 (MemoryInstrumentationClient):
337 (MemoryInstrumentation):
338 (WTF::MemoryInstrumentation::addRawBuffer):
339 (WTF::MemoryInstrumentation::MemberTypeTraits::addObject):
340 (WTF::MemoryInstrumentation::addObjectImpl):
342 2012-12-21 Ilya Tikhonovsky <loislo@chromium.org>
344 Unreviewed. Another try to fix Apple Win Release build.
346 * wtf/FastMalloc.cpp:
349 2012-12-21 Ilya Tikhonovsky <loislo@chromium.org>
351 Unreviewed compilation fix for Apple Win Release after r138398.
353 * wtf/FastMalloc.cpp:
356 2012-12-21 Oliver Hunt <oliver@apple.com>
358 Further harden FastMalloc
359 https://bugs.webkit.org/show_bug.cgi?id=105656
361 Reviewed by Gavin Barraclough.
363 This increases the degree to which we harden the FastMalloc
364 linked lists. We now also mask the previous and next pointers
365 in the doubly linked list implementation. I've also made
366 the masking itself somewhat more complex without a measurable
367 cost. We still use ASLR to provide some general entropy, but
368 we blind the pointers against each nodes 'this' pointer.
370 * wtf/FastMalloc.cpp:
376 (WTF::Span::setNext):
377 (WTF::Span::setPrev):
379 As Span now has to do masking on the next and previous pointers,
380 I've updated the code to use accessors instead.
386 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects):
387 (WTF::TCMalloc_PageHeap::scavenge):
388 (WTF::TCMalloc_PageHeap::New):
389 (WTF::TCMalloc_PageHeap::AllocLarge):
390 (WTF::TCMalloc_PageHeap::ReturnedBytes):
391 (WTF::TCMalloc_PageHeap::Check):
392 (WTF::TCMalloc_PageHeap::CheckList):
393 (WTF::TCMalloc_PageHeap::ReleaseFreeList):
394 (WTF::TCMalloc_Central_FreeList::FetchFromSpans):
396 2012-12-20 Ryuan Choi <ryuan.choi@samsung.com>
398 [EFL] Build break with latest EFL libraries.
399 https://bugs.webkit.org/show_bug.cgi?id=104827
401 Reviewed by Laszlo Gombos.
403 The eo EFL package is introduced and evas and ecore use it since 1.8.
404 While introducing Eo, EFL changed several structures of Evas and Ecore
405 from own specific class to Eo.
407 So, this patch adds FindEo and changes declaration of Evas, Evas_Object,
408 Ecore_Timer to build with latest EFL libraries.
410 * wtf/OwnPtrCommon.h: Modified declaration of Evas_Object and Ecore_Timer.
411 * wtf/PlatformEfl.cmake: Includes eo EFL library.
412 * wtf/efl/RefPtrEfl.h: Modified declaration of Evas_Object.
414 2012-12-20 Oliver Hunt <oliver@apple.com>
416 Harden pointers in FastMalloc's singly linked list implementation
417 https://bugs.webkit.org/show_bug.cgi?id=105571
419 Reviewed by Gavin Barraclough.
421 Add simple xor based hardening of the next pointer in the
422 fast malloc singly linked list implementation. We rely on
423 ASLR to introduce the address randomness we want for the mask.
424 Happily this produces a very low cost random value to use.
426 * wtf/FastMalloc.cpp:
431 2012-12-19 Oliver Hunt <oliver@apple.com>
433 StringImpl isolatedCopy unnecessarily copies text-segment character data
434 https://bugs.webkit.org/show_bug.cgi?id=105376
436 Reviewed by Anders Carlsson.
438 This patch adds a new (private) helper to StringImpl that tests whether the StringImpl
439 is backed by an ASCII literal. This allows isolatedCopy() to safely use the createFromLiteral
440 constructor rather than making an unnecessary copy.
442 * wtf/text/StringImpl.h:
444 (WTF::StringImpl::isASCIILiteral):
445 (WTF::StringImpl::isolatedCopy):
447 2012-12-19 Oliver Hunt <oliver@apple.com>
449 WTF String from ASCIILiteral fails to correctly handle empty strings.
450 https://bugs.webkit.org/show_bug.cgi?id=105453
452 Reviewed by Anders Carlsson.
454 When we have an zero length literal we should return the empty StringImpl.
456 * wtf/text/StringImpl.cpp:
457 (WTF::StringImpl::createFromLiteral):
459 2012-12-18 Yury Semikhatsky <yurys@chromium.org>
461 Web Inspector: show cached images under MemoryCache -> Images section
462 https://bugs.webkit.org/show_bug.cgi?id=105261
464 Reviewed by Pavel Feldman.
466 Use first provided name and class name. If one of the ancestors tries to overwrite
467 it just ignore the call.
469 * wtf/MemoryObjectInfo.h:
470 (WTF::MemoryObjectInfo::setClassName):
471 (WTF::MemoryObjectInfo::setName):
473 2012-12-18 Uli Schlachter <psychon@znc.in>
475 Implement uncommitted memory for Linux.
476 https://bugs.webkit.org/show_bug.cgi?id=65766
478 Reviewed by Simon Hausmann.
480 The old approach used MAP_NORESERVE to allocate address space without
481 committing it. However, that flag gets ignored if
482 /proc/sys/vm/overcommit_memory is set to 2. The new approach uses a
483 mapping with PROT_NONE. This works because mappings which aren't even
484 readable don't get accounted as committed on Linux.
486 * wtf/OSAllocatorPosix.cpp:
487 (WTF::OSAllocator::reserveUncommitted):
488 (WTF::OSAllocator::reserveAndCommit):
489 (WTF::OSAllocator::commit):
490 (WTF::OSAllocator::decommit):
492 2012-12-17 Ilya Tikhonovsky <loislo@chromium.org>
494 Web Inspector: Native Memory Instrumentation: MemoryInstrumentation doesn't detect reportMemoryUsage method defined in a base class.
495 https://bugs.webkit.org/show_bug.cgi?id=105026
497 Reviewed by Yury Semikhatsky.
499 Old SFINAE test was replaced with new one based on this article:
500 http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions
502 * wtf/MemoryInstrumentation.h:
503 (MemoryInstrumentation):
507 (WTF::MemoryInstrumentation::IsInstrumented::BaseMixin::reportMemoryUsage):
508 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
509 (InstrumentationSelector):
511 (WTF::::reportObjectMemoryUsage):
513 2012-12-17 Ilya Tikhonovsky <loislo@chromium.org>
515 Unreviewed, rolling out r137892.
516 http://trac.webkit.org/changeset/137892
517 https://bugs.webkit.org/show_bug.cgi?id=105026
519 it broke compilation on windows
521 * wtf/MemoryInstrumentation.h:
522 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
523 (MemoryInstrumentation):
524 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
525 (WTF::reportMemoryUsage):
527 2012-12-14 Ilya Tikhonovsky <loislo@chromium.org>
529 Web Inspector: Native Memory Instrumentation: MemoryInstrumentation doesn't detect reportMemoryUsage method defined in a base class.
530 https://bugs.webkit.org/show_bug.cgi?id=105026
532 Reviewed by Yury Semikhatsky.
534 Old SFINAE test was replaced with new one based on this article:
535 http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions
537 * wtf/MemoryInstrumentation.h:
538 (MemoryInstrumentation):
542 (WTF::MemoryInstrumentation::IsInstrumented::BaseMixin::reportMemoryUsage):
543 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
544 (InstrumentationSelector):
546 (WTF::::reportObjectMemoryUsage):
548 2012-12-14 Yury Semikhatsky <yurys@chromium.org>
550 Web Inspector: add data grid for exploring native heap graph
551 https://bugs.webkit.org/show_bug.cgi?id=105012
553 Reviewed by Pavel Feldman.
555 Do not report edges with null target.
557 * wtf/MemoryInstrumentation.h:
558 (WTF::MemoryInstrumentation::addObjectImpl):
560 2012-12-13 Filip Pizlo <fpizlo@apple.com>
562 Attempt to rationalize and simplify WTF::binarySearch
563 https://bugs.webkit.org/show_bug.cgi?id=104890
565 Reviewed by Maciej Stachowiak.
567 Binary search now has three modes:
569 The default: assert that the key was found, but return an adjacent element if it
570 wasn't found, if asserts are turned off.
572 tryBinarySearch: return 0 if the key wasn't found.
574 approximateBinarySearch: if the key is not found, return an adjacent element (either
575 the left or right; no guarantee which).
577 This also reduces the number of variants of binarySearch. The functor variant is now
578 gone because binarySearch now always uses a functor for the key extractor. The
579 generic variant is now gone because binarySearch always expects an array type that
582 * wtf/StdLibExtras.h:
583 (WTF::binarySearchImpl):
585 (WTF::tryBinarySearch):
586 (WTF::approximateBinarySearch):
588 2012-12-13 Ilya Tikhonovsky <loislo@chromium.org>
590 Web Inspector: Native Memory Instrumentation: do not validate pointers to objects in RenderArena agains tcmalloc data.
591 https://bugs.webkit.org/show_bug.cgi?id=104903
593 Reviewed by Yury Semikhatsky.
595 This is a simplest approach to do that with zero performance overhead.
597 * wtf/MemoryInstrumentation.cpp:
598 (WTF::MemoryClassInfo::setCustomAllocation):
600 * wtf/MemoryInstrumentation.h:
602 * wtf/MemoryObjectInfo.h:
603 (WTF::MemoryObjectInfo::MemoryObjectInfo):
604 (WTF::MemoryObjectInfo::customAllocation):
605 (WTF::MemoryObjectInfo::setCustomAllocations):
608 2012-12-12 Ilya Tikhonovsky <loislo@chromium.org>
610 Web Inspector: Native Memory Instrumentation: remove fake root MemoryObjectInfo.
611 https://bugs.webkit.org/show_bug.cgi?id=104796
613 Reviewed by Yury Semikhatsky.
615 It was not a good idea to introduce a fake root MemoryObjectInfo.
616 It makes a problem when we visit an object without its own MemoryObjectType.
618 Example: RenderBox has a global pointer to a hash map.
619 HashMap doesn't have its own object type because it is a generic container.
620 It will inherit object type from the fake root memory object info.
621 The same could happen for another container in another class with other MemoryObjectType.
623 This fact forces me to create custom process method for root objects
624 because they need to have their own MemoryObjectInfo with customisable memory object type.
626 Drive by fix: InstrumentedPointer* was replaced with Wrapper* because actually it is using
627 for instrumented and not instrumented object classes.
629 * wtf/MemoryInstrumentation.cpp:
630 (WTF::MemoryInstrumentation::MemoryInstrumentation):
631 (WTF::MemoryInstrumentation::WrapperBase::WrapperBase):
632 (WTF::MemoryInstrumentation::WrapperBase::process):
633 (WTF::MemoryInstrumentation::WrapperBase::processRootObjectRef):
635 * wtf/MemoryInstrumentation.h:
636 (WTF::MemoryInstrumentation::addRootObject):
637 (MemoryInstrumentation):
639 (WTF::MemoryInstrumentation::WrapperBase::~WrapperBase):
642 (WTF::MemoryInstrumentation::OwningTraits::addRootObject):
643 (WTF::MemoryInstrumentation::addObjectImpl):
645 (WTF::::callReportMemoryUsage):
647 2012-12-12 Sergio Martins <sergio.martins@kdab.com>
649 Fix QNX Qt build by enabling JIT.
650 https://bugs.webkit.org/show_bug.cgi?id=102794
652 Reviewed by Simon Hausmann.
654 JIT is working, so enable it. Otherwise LLINT gets enabled, and
655 that doesn't compile.
657 YARR_JIT is crashing at this time though, so disable it.
661 2012-12-11 Ilya Tikhonovsky <loislo@chromium.org>
663 Web Inspector: Native Memory Instrumentation: simplify Sequences processing code.
664 https://bugs.webkit.org/show_bug.cgi?id=104777
666 Reviewed by Yury Semikhatsky.
668 Redesign reportMemoryUsage for the sequences.
669 With the old schema we couldn't instrument HashMap<key, WebCore::LayoutUnit>
670 because LayoutUnit has overloaded conversion operators for double, int, etc.
671 I wrote an empty SequenceMemoryInstrumentationTraits for LayoutUnit class
672 but it doesn't help because the root of problem was hidden in the free template function reportSequenceMemoryUsage.
673 I could overload reportSequenceMemoryUsage too but in this case I need to fully specify all the types
674 for the iterators like HashMap<.....>::const_iterator. Too many letters.
675 I found a better solution. Free reportSequenceMemoryUsage can be converted into default implementation of static
676 reportMemoryUsage traits method. In this case the types of iterators will be inferred automaticaly. The old default
677 implementation becomes a custom implementation for the user defined types.
679 * wtf/MemoryInstrumentationHashCountedSet.h:
680 (WTF::reportMemoryUsage):
681 * wtf/MemoryInstrumentationHashMap.h:
682 (WTF::reportMemoryUsage):
683 * wtf/MemoryInstrumentationHashSet.h:
684 (WTF::reportMemoryUsage):
685 * wtf/MemoryInstrumentationListHashSet.h:
686 (WTF::reportMemoryUsage):
687 * wtf/MemoryInstrumentationSequence.h:
689 (WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
690 (SequenceMemoryInstrumentationTraits):
691 * wtf/MemoryInstrumentationVector.h:
692 (WTF::reportMemoryUsage):
694 2012-12-10 Yury Semikhatsky <yurys@chromium.org>
696 Memory instrumentation: make sure each edge is reported only once
697 https://bugs.webkit.org/show_bug.cgi?id=104630
699 Reviewed by Pavel Feldman.
701 Make sure that outgoing edges are reported only once if we come to the same
702 object twice: first by an address of a base class and then by a real address
705 * wtf/MemoryInstrumentation.cpp:
706 (WTF::MemoryInstrumentation::MemoryInstrumentation):
707 (WTF::MemoryInstrumentation::reportLinkToBuffer):
708 (WTF::MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase):
709 (WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
710 (WTF::MemoryClassInfo::init):
711 (WTF::MemoryClassInfo::addRawBuffer):
712 (WTF::MemoryClassInfo::addPrivateBuffer):
713 * wtf/MemoryInstrumentation.h:
714 (InstrumentedPointerBase):
715 (MemoryInstrumentation):
716 (InstrumentedPointer):
717 (WTF::MemoryClassInfo::MemoryClassInfo):
718 (WTF::MemoryClassInfo::addMember):
720 (WTF::::InstrumentedPointer):
721 (WTF::::callReportMemoryUsage):
722 * wtf/MemoryObjectInfo.h:
723 (WTF::MemoryObjectInfo::MemoryObjectInfo):
724 (WTF::MemoryObjectInfo::firstVisit):
725 (WTF::MemoryObjectInfo::className):
726 (WTF::MemoryObjectInfo::name):
727 (WTF::MemoryObjectInfo::setAlreadyVisited):
730 2012-12-10 Benjamin Poulain <benjamin@webkit.org>
732 Add convenience methods to use ListHashSet for a LRU cache
733 https://bugs.webkit.org/show_bug.cgi?id=104499
735 Reviewed by Sam Weinig.
737 ListHashSet is a great abstract data type to implement caches.
738 Unfortunately, the class was missing methods to do that easily and
739 efficiently. This patch fixes that.
741 The names appendOrMoveToLast() and prependOrMoveToFirst() were chosen
742 in favor of append()/prepend() to ensure they are not used in place of
747 (WTF::::removeFirst):
748 (WTF::::appendOrMoveToLast):
749 (WTF::::prependOrMoveToFirst):
751 (WTF::::unlinkAndDelete):
752 (WTF::::prependNode):
754 2012-12-10 Eric Carlson <eric.carlson@apple.com>
756 Add support for in-band text tracks to Mac port
757 https://bugs.webkit.org/show_bug.cgi?id=103663
759 Reviewed by Sam Weinig.
761 * wtf/Platform.h: Define HAVE_AVFOUNDATION_TEXT_TRACK_SUPPORT.
763 2012-12-08 Patrick Gansterer <paroga@webkit.org>
765 Compiling WTF outside of WebKit failed on Windows
766 https://bugs.webkit.org/show_bug.cgi?id=100201
768 Reviewed by Darin Adler.
770 Explicitly use the Unicode variants of the Windows API to
771 allow building the WTF library without the UNICODE define.
773 * wtf/win/MainThreadWin.cpp:
774 (WTF::initializeMainThreadPlatform):
776 2012-12-08 Gustavo Noronha Silva <gns@gnome.org>
778 Unreviewed trivial space fix to silence an automake warning.
780 * GNUmakefile.list.am:
782 2012-12-05 Halton Huo <halton.huo@intel.com>
784 [CMake] Unify coding style for CMake files
785 https://bugs.webkit.org/show_bug.cgi?id=103605
787 Reviewed by Laszlo Gombos.
789 Update cmake files(.cmake, CMakeLists.txt) with following style rules:
791 1.1 Use spaces, not tabs.
792 1.2 Four spaces as indent.
794 2.1 Place one space between control statements and their parentheses.
795 For eg, if (), else (), elseif (), endif (), foreach (),
796 endforeach (), while (), endwhile (), break ().
797 2.2 Do not place spaces between function and macro statements and
798 their parentheses. For eg, macro(), endmacro(), function(),
800 2.3 Do not place spaces between a command or function or macro and its
801 parentheses, or between a parenthesis and its content. For eg,
802 message("testing") not message( "testing") or message ("testing" )
803 2.4 No space at line ending.
804 3. Lowercase when call commands macros and functions. For eg,
805 add_executable() not ADD_EXECUTABLE(), set() not SET().
808 * wtf/CMakeLists.txt:
809 * wtf/PlatformBlackBerry.cmake:
810 * wtf/PlatformEfl.cmake:
811 * wtf/PlatformWinCE.cmake:
813 2012-12-04 Jon Lee <jonlee@apple.com>
815 Extend StringHasher to take a stream of characters
816 https://bugs.webkit.org/show_bug.cgi?id=104076
817 <rdar://problem/12811887>
819 Reviewed by Darin Adler.
821 We essentially move computeHash() to a member function of StringHasher. This allows clients of the
822 hasher to append strings to the general hash, without having to first concatenate the strings.
824 * wtf/StringHasher.h:
825 (WTF::StringHasher::addCharacters): Same as computeHash(), except also take into account the possibility
826 that there is a pending character to hash. If this is the case, we align the word boundary by consuming the
827 first character in data, adjust the length, move the data pointer forward one, and update the hasher's
828 pending character state. Also add an early return so that we are guaranteed at least one character in case
829 we run into this situation.
830 (WTF::StringHasher::computeHash): Refactor into addCharacters().
832 2012-12-04 Yury Semikhatsky <yurys@chromium.org>
834 Web Inspector: simplify reportMemoryUsage signature
835 https://bugs.webkit.org/show_bug.cgi?id=104028
837 Reviewed by Vsevolod Vlasov.
839 Removed const& modifier from instrumented pointer type. Was const T* const&,
842 * wtf/MemoryInstrumentation.cpp:
843 (WTF::MemoryClassInfo::addRawBuffer):
844 * wtf/MemoryInstrumentation.h:
845 (MemoryInstrumentation):
846 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
847 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
849 (WTF::reportMemoryUsage):
850 (WTF::MemoryInstrumentation::addObjectImpl):
852 * wtf/MemoryInstrumentationArrayBufferView.h:
853 (WTF::reportMemoryUsage):
854 * wtf/MemoryInstrumentationHashCountedSet.h:
855 (WTF::reportMemoryUsage):
856 * wtf/MemoryInstrumentationHashMap.h:
857 (WTF::reportMemoryUsage):
858 * wtf/MemoryInstrumentationHashSet.h:
859 (WTF::reportMemoryUsage):
860 * wtf/MemoryInstrumentationListHashSet.h:
861 (WTF::reportMemoryUsage):
862 * wtf/MemoryInstrumentationParsedURL.h:
863 (WTF::reportMemoryUsage):
864 * wtf/MemoryInstrumentationString.h:
865 (WTF::reportMemoryUsage):
866 * wtf/MemoryInstrumentationVector.h:
867 (WTF::reportMemoryUsage):
869 2012-12-01 Filip Pizlo <fpizlo@apple.com>
871 JSC should be able to report profiling data associated with the IR dumps and disassembly
872 https://bugs.webkit.org/show_bug.cgi?id=102999
874 Reviewed by Gavin Barraclough.
876 Made some minor changes to support the new profiler. FileOutputStream now has an
877 open() method, and DataLog uses it. StringPrintStream has a reset() method, which
878 allows you to reuse the same StringPrintStream for creating multiple strings.
879 SegmentedVector now has a const operator[]. And, WTFString now can do fromUTF8() on
883 (WTF::initializeLogFileOnce):
884 * wtf/FilePrintStream.cpp:
885 (WTF::FilePrintStream::open):
887 * wtf/FilePrintStream.h:
888 * wtf/SegmentedVector.h:
889 (WTF::SegmentedVector::at):
891 (WTF::SegmentedVector::operator[]):
892 * wtf/StringPrintStream.cpp:
893 (WTF::StringPrintStream::reset):
895 * wtf/StringPrintStream.h:
897 * wtf/text/WTFString.cpp:
898 (WTF::String::fromUTF8):
900 * wtf/text/WTFString.h:
903 2012-12-04 Sheriff Bot <webkit.review.bot@gmail.com>
905 Unreviewed, rolling out r136597.
906 http://trac.webkit.org/changeset/136597
907 https://bugs.webkit.org/show_bug.cgi?id=104065
909 broke Windows compilation (Requested by yurys on #webkit).
911 * wtf/MemoryInstrumentation.cpp:
912 (WTF::MemoryClassInfo::addRawBuffer):
913 * wtf/MemoryInstrumentation.h:
914 (MemoryInstrumentation):
915 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
916 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
918 (WTF::reportMemoryUsage):
919 (WTF::MemoryInstrumentation::addObjectImpl):
921 * wtf/MemoryInstrumentationArrayBufferView.h:
922 (WTF::reportMemoryUsage):
923 * wtf/MemoryInstrumentationHashCountedSet.h:
924 (WTF::reportMemoryUsage):
925 * wtf/MemoryInstrumentationHashMap.h:
926 (WTF::reportMemoryUsage):
927 * wtf/MemoryInstrumentationHashSet.h:
928 (WTF::reportMemoryUsage):
929 * wtf/MemoryInstrumentationListHashSet.h:
930 (WTF::reportMemoryUsage):
931 * wtf/MemoryInstrumentationParsedURL.h:
932 (WTF::reportMemoryUsage):
933 * wtf/MemoryInstrumentationString.h:
934 (WTF::reportMemoryUsage):
935 * wtf/MemoryInstrumentationVector.h:
936 (WTF::reportMemoryUsage):
938 2012-12-04 Yury Semikhatsky <yurys@chromium.org>
940 Web Inspector: simplify reportMemoryUsage signature
941 https://bugs.webkit.org/show_bug.cgi?id=104028
943 Reviewed by Vsevolod Vlasov.
945 Removed const& modifier from instrumented pointer type. Was const T* const&,
948 * wtf/MemoryInstrumentation.cpp:
949 (WTF::MemoryClassInfo::addRawBuffer):
950 * wtf/MemoryInstrumentation.h:
951 (MemoryInstrumentation):
952 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
953 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
955 (WTF::reportMemoryUsage):
956 (WTF::MemoryInstrumentation::addObjectImpl):
958 * wtf/MemoryInstrumentationArrayBufferView.h:
959 (WTF::reportMemoryUsage):
960 * wtf/MemoryInstrumentationHashCountedSet.h:
961 (WTF::reportMemoryUsage):
962 * wtf/MemoryInstrumentationHashMap.h:
963 (WTF::reportMemoryUsage):
964 * wtf/MemoryInstrumentationHashSet.h:
965 (WTF::reportMemoryUsage):
966 * wtf/MemoryInstrumentationListHashSet.h:
967 (WTF::reportMemoryUsage):
968 * wtf/MemoryInstrumentationParsedURL.h:
969 (WTF::reportMemoryUsage):
970 * wtf/MemoryInstrumentationString.h:
971 (WTF::reportMemoryUsage):
972 * wtf/MemoryInstrumentationVector.h:
973 (WTF::reportMemoryUsage):
975 2012-12-03 Yury Semikhatsky <yurys@chromium.org>
977 Web Inspector: NMI introduce heap graph recording API
978 https://bugs.webkit.org/show_bug.cgi?id=103232
980 Reviewed by Vsevolod Vlasov.
982 MemoryInstrumentationClient is extended with several methods for reporting
983 heap graph vertices and edges. Edge source is always idenfied by heap object
984 address. Target node might be either a destination object address(either real
985 or adjusted if the edge was retrieved from a pointer to a base class) or a
986 MemoryObjectInfo in case of internal buffers.
988 * wtf/MemoryInstrumentation.cpp:
989 (WTF::MemoryInstrumentation::reportEdge):
991 (WTF::MemoryInstrumentation::reportLinkToBuffer): report edge between the object
992 and a buffer which it owns.
993 (WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
994 (WTF::MemoryClassInfo::addRawBuffer):
995 (WTF::MemoryClassInfo::addPrivateBuffer):
996 * wtf/MemoryInstrumentation.h:
997 (MemoryInstrumentationClient):
998 (WTF::MemoryInstrumentationClient::reportNode):
999 (WTF::MemoryInstrumentationClient::reportEdge):
1000 (WTF::MemoryInstrumentationClient::reportLeaf):
1001 (WTF::MemoryInstrumentationClient::reportBaseAddress): if we found an object by a pointer
1002 to base class it may have different value than real object address. Report both real and
1003 adjusted addresses so that they both can be used for identifying corresponding heap graph
1005 (WTF::MemoryInstrumentation::addRootObject):
1006 (MemoryInstrumentation):
1007 (WTF::MemoryInstrumentation::addObject):
1008 (WTF::MemoryInstrumentation::addRawBuffer):
1009 (WTF::MemoryInstrumentation::OwningTraits::addObject):
1010 (WTF::MemoryClassInfo::addMember):
1012 (WTF::MemoryInstrumentation::addObjectImpl):
1013 * wtf/MemoryObjectInfo.h: added methods for repoting class name and some name string.
1014 (WTF::MemoryObjectInfo::setClassName):
1015 (WTF::MemoryObjectInfo::setName):
1018 2012-12-03 Filip Pizlo <fpizlo@apple.com>
1020 Replace JSValue::description() with JSValue::dump(PrintStream&)
1021 https://bugs.webkit.org/show_bug.cgi?id=103866
1023 Reviewed by Darin Adler.
1025 Make it easier to get a String from a StringPrintStream.
1027 * wtf/StringPrintStream.cpp:
1028 (WTF::StringPrintStream::toString):
1029 * wtf/StringPrintStream.h:
1030 (StringPrintStream):
1033 2012-12-02 Filip Pizlo <fpizlo@apple.com>
1035 It should be possible to build and run with DFG_ENABLE(PROPAGATION_VERBOSE)
1036 https://bugs.webkit.org/show_bug.cgi?id=103848
1038 Reviewed by Sam Weinig.
1040 Increase the variadicity of dataLog() and print(), and add a pointerDump()
1041 which allows passing a pointer to something that has a printInternal(). If
1042 the pointer is null, it'll print "(null)"; otherwise it'll invoke the
1043 printInternal() function.
1048 * wtf/PrintStream.h:
1050 (WTF::PrintStream::print):
1053 (WTF::PointerDump::PointerDump):
1054 (WTF::PointerDump::dump):
1057 2012-11-30 Simon Hausmann <simon.hausmann@digia.com>, Pierre Rossi <pierre.rossi@digia.com>
1059 [Qt] Separate Qt WebKit into Qt WebKit and Qt WebKit Widgets
1060 https://bugs.webkit.org/show_bug.cgi?id=99314
1062 Reviewed by Tor Arne Vestbø.
1064 This big change separates QtWebKit into QtWebKit and QtWebKitWidgets as
1067 It's a big refactoring that mostly involves moving WebCore dependent
1068 code into QtWebKit and accessing it through exported QWebFrameAdapter
1069 and QWebPageAdapter classes.
1072 * wtf/text/WTFString.h:
1073 (String): Export the QString conversions also as WTF_STRING_API.
1075 2012-11-29 Filip Pizlo <fpizlo@apple.com>
1077 It should be easy to find code blocks in debug dumps
1078 https://bugs.webkit.org/show_bug.cgi?id=103623
1080 Reviewed by Geoffrey Garen.
1082 Changed RawPointer to accept both const void* and void*, and use the former internally.
1084 Cleaned up SHA1 so that the functionality already used internally for self-testing is
1085 available via the API. This includes addBytes(CString) and computing hex digests.
1088 (WTF::RawPointer::RawPointer):
1090 (WTF::RawPointer::value):
1093 (WTF::SHA1::hexDigest):
1094 (WTF::SHA1::computeHexDigest):
1096 (WTF::SHA1::addBytes):
1098 2012-11-29 Patrick Gansterer <paroga@webkit.org>
1100 Build fix for WinCE after r136096.
1102 * wtf/StringPrintStream.cpp: Added missing include file.
1104 2012-11-28 Filip Pizlo <fpizlo@apple.com>
1106 SpeculatedType dumping should not use the static char buffer[thingy] idiom
1107 https://bugs.webkit.org/show_bug.cgi?id=103584
1109 Reviewed by Michael Saboff.
1111 Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives.
1113 * GNUmakefile.list.am:
1116 * WTF.vcproj/WTF.vcproj:
1117 * WTF.xcodeproj/project.pbxproj:
1118 * wtf/CMakeLists.txt:
1119 * wtf/PrintStream.cpp:
1120 (WTF::dumpCharacter):
1121 * wtf/PrintStream.h:
1122 (WTF::printInternal):
1123 * wtf/StringPrintStream.cpp: Added.
1124 (WTF::StringPrintStream::StringPrintStream):
1125 (WTF::StringPrintStream::~StringPrintStream):
1126 (WTF::StringPrintStream::vprintf):
1127 (WTF::StringPrintStream::toCString):
1128 (WTF::StringPrintStream::increaseSize):
1129 * wtf/StringPrintStream.h: Added.
1130 (StringPrintStream):
1133 2012-11-28 Michael Saboff <msaboff@apple.com>
1135 Update String Stats for recent dataLog changes and add summary
1136 https://bugs.webkit.org/show_bug.cgi?id=103583
1138 Reviewed by Filip Pizlo.
1140 Updated calls to dataLog() to dataLogF() as a results of r135469.
1141 Added total savings from 8 bit strings in bytes and as a percentage.
1143 * wtf/text/StringImpl.cpp:
1144 (WTF::StringStats::printStats):
1146 2012-11-28 Roger Fong <roger_fong@apple.com>
1148 Make DataLog work/compile properly on Windows.
1149 https://bugs.webkit.org/show_bug.cgi?id=103544
1151 Reviewed by Filip Pizlo.
1154 (WTF::initializeLogFileOnce):
1156 2012-11-28 Filip Pizlo <fpizlo@apple.com>
1158 It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count)
1159 https://bugs.webkit.org/show_bug.cgi?id=103009
1161 Reviewed by Michael Saboff.
1163 Added the ability to use out.print(...) and dataLog(...) variadically and with
1164 WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want
1165 to be able to pass as an argument to out.print() or dataLog(). Also added one
1166 example class for doing this: RawPointer, which can be used to force a pointer
1167 to be printed as "%p" rather than matching any overloads that you might want to
1170 * GNUmakefile.list.am:
1173 * WTF.vcproj/WTF.vcproj:
1174 * WTF.xcodeproj/project.pbxproj:
1175 * wtf/CMakeLists.txt:
1179 * wtf/PrintStream.cpp:
1180 (WTF::printInternal):
1182 * wtf/PrintStream.h:
1184 (WTF::PrintStream::print):
1186 * wtf/RawPointer.h: Added.
1189 (WTF::RawPointer::RawPointer):
1190 (WTF::RawPointer::value):
1192 2012-11-27 Filip Pizlo <fpizlo@apple.com>
1194 Convert some remaining uses of FILE* to PrintStream&.
1196 Rubber stamped by Mark Hahnenberg.
1198 * wtf/BitVector.cpp:
1199 (WTF::BitVector::dump):
1203 2012-11-27 Pratik Solanki <psolanki@apple.com>
1205 objc/objc-runtime.h does not exist on all PLATFORM(MAC)
1206 https://bugs.webkit.org/show_bug.cgi?id=101780
1208 Reviewed by Brent Fulgham.
1210 Clean up header includes so we don't include objc/objc-runtime.h.
1213 * wtf/ObjcRuntimeExtras.h: Include objc/message.h here so we don't rely on proper ordering
1214 of includes in files that include this header.
1216 2012-11-27 Sheriff Bot <webkit.review.bot@gmail.com>
1218 Unreviewed, rolling out r135828.
1219 http://trac.webkit.org/changeset/135828
1220 https://bugs.webkit.org/show_bug.cgi?id=103405
1222 [Chromium] Multiple ASAN errors after a WebKit roll due to
1223 mismatched malloc/delete (not free) resulting from
1224 StringImpl::deref() (Requested by apavlov on #webkit).
1226 * wtf/FastAllocBase.h:
1229 2012-11-26 Adam Barth <abarth@webkit.org>
1231 [Chromium] fastMalloc has an extra branch on Windows
1232 https://bugs.webkit.org/show_bug.cgi?id=103027
1234 Reviewed by Eric Seidel.
1236 There's no need to override the new/delete operators on non-Mac
1239 1) We use the system malloc anyway.
1240 2) We've modified the system malloc to crash in out-of-memory conditions.
1242 This patch removes a branch (and a call) from malloc, which will
1243 hopefully improve performance. I haven't measured the performance
1244 characteristics of this patch, but I will look at the graphs closely
1247 * wtf/FastAllocBase.h:
1250 2012-11-26 Filip Pizlo <fpizlo@apple.com>
1252 DataLog to a file should work if there are multiple processes using WTF
1253 https://bugs.webkit.org/show_bug.cgi?id=103323
1255 Reviewed by Mark Hahnenberg.
1257 Whereas before DataLog would open a file with the name you specified, now it'll open a file with the
1258 name plus the PID appended to it. So if you are dealing with multiple processes running with DataLog
1259 to a file enabled, you'll get multiple separate log files.
1262 (WTF::initializeLogFileOnce):
1264 2012-11-26 Zeno Albisser <zeno@webkit.org>
1266 [Qt] Fix the LLInt build on Mac
1267 https://bugs.webkit.org/show_bug.cgi?id=97587
1269 Reviewed by Simon Hausmann.
1272 Use OS(DARWIN) instead of PLATFORM(MAC),
1273 in order to allow Qt to use the same code.
1276 2012-11-26 Patrick Gansterer <paroga@webkit.org>
1278 Build fix for WinCE after r135640.
1282 2012-11-24 Adam Barth <abarth@webkit.org>
1284 Chromium should use TCMalloc on Mac to go fast
1285 https://bugs.webkit.org/show_bug.cgi?id=102866
1287 Reviewed by Eric Seidel.
1289 This patch enables TCMalloc for some WebKit objects. It improves
1290 dom-modify on Mac by 5-10%.
1292 On non-Mac platforms, Chromium already uses TCMalloc throughout the
1293 project. Unfortunately, we haven't yet figured out how to turn TCMalloc
1294 on globally on Mac because the approach we use for other platforms makes
1297 The next best thing would be to enable TCMalloc for WebKit by
1298 overriding the global new and delete operator, as is done on apple-mac
1299 and other platforms. Unfortunately, we cannot use that approach either
1300 because the Chromium WebKit API is not memory tight.
1302 Fortunately, WebKit has a mechanism for selectively enabling TCMalloc
1303 for a selection of objects by overriding the new and delete operators
1304 on those objects. This patch opts chromium-mac into that scheme by
1305 setting the appropriate preprocessor macros.
1310 2012-11-21 Filip Pizlo <fpizlo@apple.com>
1312 Any function that can log things should be able to easily log them to a memory buffer as well
1313 https://bugs.webkit.org/show_bug.cgi?id=103000
1315 Reviewed by Sam Weinig.
1317 We have a number of places where we pass around a FILE* as a target to which to print
1318 some logging information. But the purpose of passing FILE* instead of always assuming
1319 that we should dump to stderr is that it may be sometimes useful to send the logging
1320 information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome
1321 to use it to send logging to a string, for example.
1323 We could get around this by using <iostream> and <sstream>, but so far this aspect of
1324 C++ has not been part of the WebKit coding conventions. Personally I find <iostream>
1325 awkward due to its abuse of operator overloading.
1327 So this patch introduces the PrintStream abstract class, which offers printf-like
1328 functionality while completely abstracting the destination and mechanism of the printing
1329 output. It would be trivial to implement a StringPrintStream, for example. This will feed
1330 into work on https://bugs.webkit.org/show_bug.cgi?id=102999.
1332 This also sets us up for creating templatized print() and println() methods that will
1333 allow us to say things like out.print("count = ", count, "\n"), but that is the topic
1334 of https://bugs.webkit.org/show_bug.cgi?id=103009.
1336 This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile()
1337 now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed
1338 to expect a PrintStream&.
1340 * GNUmakefile.list.am:
1342 * WTF.vcproj/WTF.vcproj:
1343 * WTF.xcodeproj/project.pbxproj:
1344 * wtf/CMakeLists.txt:
1347 (WTF::initializeLogFileOnce):
1348 (WTF::initializeLogFile):
1351 (WTF::dataLogString):
1354 * wtf/FilePrintStream.cpp: Added.
1356 (WTF::FilePrintStream::FilePrintStream):
1357 (WTF::FilePrintStream::~FilePrintStream):
1358 (WTF::FilePrintStream::vprintf):
1359 (WTF::FilePrintStream::flush):
1360 * wtf/FilePrintStream.h: Added.
1363 (WTF::FilePrintStream::file):
1364 * wtf/PrintStream.cpp: Added.
1366 (WTF::PrintStream::PrintStream):
1367 (WTF::PrintStream::~PrintStream):
1368 (WTF::PrintStream::printf):
1369 (WTF::PrintStream::print):
1370 (WTF::PrintStream::println):
1371 (WTF::PrintStream::flush):
1373 * wtf/PrintStream.h: Added.
1379 2012-11-23 Robert Kroeger <rjkroege@chromium.org>
1381 Remove unused ScrollByPixelVelocity
1382 https://bugs.webkit.org/show_bug.cgi?id=102840
1384 Reviewed by Sam Weinig.
1386 The GESTURE_ANIMATION feature turns on code in WebCore is unused.
1389 No new tests: code removal/cleanup.
1393 2012-11-23 Laszlo Gombos <l.gombos@samsung.com>
1395 [EFL] Define WTF_PLATFORM_EFL in Platform.h
1396 https://bugs.webkit.org/show_bug.cgi?id=101482
1398 Reviewed by Kenneth Rohde Christiansen.
1400 Define WTF_PLATFORM_EFL in Platform.h to be consistent with
1405 2012-11-16 Yury Semikhatsky <yurys@chromium.org>
1407 Memory instrumentation: extract MemoryObjectInfo declaration into a separate file
1408 https://bugs.webkit.org/show_bug.cgi?id=102510
1410 Reviewed by Pavel Feldman.
1412 Moved MemoryObjectInfo into separate header. Moved definition of MemoryInstrumentation
1413 methods that depend on MemoryObjectInfo declaration into MemoryInstrumentation.cpp to
1414 make MemoryInstrumentation require only forward declaration of MemoryObjectInfo.
1416 * GNUmakefile.list.am:
1419 * WTF.vcproj/WTF.vcproj:
1420 * wtf/CMakeLists.txt:
1421 * wtf/MemoryInstrumentation.cpp: Added.
1423 (WTF::MemoryInstrumentation::MemoryInstrumentation):
1424 (WTF::MemoryInstrumentation::~MemoryInstrumentation):
1425 (WTF::MemoryInstrumentation::getObjectType): this method allows to get object type without
1426 pulling in MemoryObjectInfo.h and all its dependencies.
1427 (WTF::MemoryInstrumentation::callReportObjectInfo):
1428 (WTF::MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase):
1429 (WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
1430 (WTF::MemoryClassInfo::init):
1431 (WTF::MemoryClassInfo::addRawBuffer):
1432 (WTF::MemoryClassInfo::addPrivateBuffer):
1433 * wtf/MemoryInstrumentation.h:
1434 (MemoryInstrumentation):
1435 (WTF::MemoryInstrumentation::addRootObject):
1436 (InstrumentedPointerBase):
1437 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
1438 (InstrumentedPointer):
1439 (WTF::MemoryInstrumentation::addObject): we now pass owner's MemoryObjectInfo in all places
1440 where we report objects pointed by the owner.
1441 (WTF::MemoryInstrumentation::OwningTraits::addObject):
1442 (WTF::MemoryClassInfo::MemoryClassInfo):
1443 (WTF::MemoryClassInfo::addMember):
1445 (WTF::MemoryInstrumentation::addObjectImpl):
1446 (WTF::::InstrumentedPointer):
1447 (WTF::::callReportMemoryUsage):
1448 * wtf/MemoryObjectInfo.h: Added.
1451 (WTF::MemoryObjectInfo::MemoryObjectInfo):
1452 (WTF::MemoryObjectInfo::objectType):
1453 (WTF::MemoryObjectInfo::objectSize):
1454 (WTF::MemoryObjectInfo::reportedPointer):
1455 (WTF::MemoryObjectInfo::memoryInstrumentation):
1456 (WTF::MemoryObjectInfo::reportObjectInfo):
1458 2012-11-23 Krzysztof Czech <k.czech@samsung.com>
1460 [EFL] Platform support for Accessibility feature.
1461 https://bugs.webkit.org/show_bug.cgi?id=100848
1463 Reviewed by Gyuyoung Kim.
1465 Enable HAVE(ACCESSIBILITY) ifdefs so that EFL port can use it.
1469 2012-11-22 Michael Saboff <msaboff@apple.com>
1471 HTML integer parsing functions don't natively handle 8 bit strings
1472 https://bugs.webkit.org/show_bug.cgi?id=102997
1474 Reviewed by Filip Pizlo.
1476 Added exports to the LChar* versions of charactersToIntStrict() and charactersToUIntStrict()
1477 to support the changes made to parseHTMLInteger() and parseHTMLNonNegativeInteger().
1479 * wtf/text/WTFString.h:
1480 (WTF::charactersToIntStrict): Added export
1481 (WTF::charactersToUIntStrict): Added export
1483 2012-11-21 Filip Pizlo <fpizlo@apple.com>
1485 Rename dataLog() and dataLogV() to dataLogF() and dataLogFV()
1486 https://bugs.webkit.org/show_bug.cgi?id=103001
1488 Rubber stamped by Dan Bernstein.
1493 (WTF::dataLogFString):
1496 * wtf/HashTable.cpp:
1497 (WTF::HashTableStats::dumpStats):
1499 (WTF::HashTable::Stats::dumpStats):
1500 * wtf/MetaAllocator.cpp:
1501 (WTF::MetaAllocator::dumpProfile):
1502 * wtf/StackStats.cpp:
1503 (WTF::StackStats::initialize):
1504 (WTF::StackStats::PerThreadStats::PerThreadStats):
1505 (WTF::StackStats::CheckPoint::CheckPoint):
1506 (WTF::StackStats::CheckPoint::~CheckPoint):
1507 (WTF::StackStats::probe):
1508 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
1509 * wtf/text/WTFString.cpp:
1512 2012-11-21 Anthony G. Basile <blueness@gentoo.org>
1514 Source/WTF/wtf/Assertions.cpp: fix build on a uClibc system
1515 https://bugs.webkit.org/show_bug.cgi?id=102946
1517 Reviewed by Tony Chang.
1519 Webkit-Gtk fails to build on a uClibc system because
1520 Assertions.cpp assumes that all Linux systems have execinfo.h
1521 and provide backtrace(). This is not necessarily the case for
1522 uClibc which can be configured without these. This patch
1523 refines the check for OS(LINUX) to prevent this breakage.
1524 Originally reported at https://bugs.gentoo.org/441674
1526 * wtf/Assertions.cpp:
1528 2012-11-19 Filip Pizlo <fpizlo@apple.com>
1530 DFG should be able to cache closure calls
1531 https://bugs.webkit.org/show_bug.cgi?id=102662
1533 Reviewed by Gavin Barraclough.
1535 Added support to the meta allocator for easily querying whether an address falls within
1536 a certain allocated chunk. Also added a useful debug routine to SentinelLinkedList,
1537 which can be used to check if a node is on a particular list.
1539 * wtf/MetaAllocatorHandle.h:
1540 (MetaAllocatorHandle):
1541 (WTF::MetaAllocatorHandle::containsIntegerAddress):
1542 (WTF::MetaAllocatorHandle::contains):
1543 * wtf/SentinelLinkedList.h:
1544 (SentinelLinkedList):
1548 2012-11-19 Laszlo Gombos <l.gombos@samsung.com>
1550 Remove ReadWriteLock
1551 https://bugs.webkit.org/show_bug.cgi?id=101637
1553 Reviewed by Darin Adler.
1555 Remove ReadWriteLock as it does not seems to be used.
1557 * wtf/Platform.h: Remove the definition of HAVE_PTHREAD_RWLOCK.
1559 * wtf/ThreadingPrimitives.h: Remove the PlatformReadWriteLock type
1560 and the ReadWriteLock class.
1562 * wtf/ThreadingPthreads.cpp: Remove the implementation of
1563 the ReadWriteLock class using pthreads.
1565 2012-11-19 Brady Eidson <beidson@apple.com>
1567 Add 64-bit specializations for atomicIncrement and atomicDecrement
1568 https://bugs.webkit.org/show_bug.cgi?id=102702
1570 Reviewed by Eric Carlson.
1573 (WTF::atomicIncrement): Add A 64-bit version for Darwin.
1574 (WTF::atomicDecrement): Ditto.
1576 2012-11-18 Laszlo Gombos <l.gombos@samsung.com>
1578 Remove non-existent directories from the make system
1579 https://bugs.webkit.org/show_bug.cgi?id=102632
1581 Reviewed by Adam Barth.
1583 Remove (non-existent) symbian references from the exclude list in gyp project files.
1587 2012-11-16 Michael Saboff <msaboff@apple.com>
1589 String::fromUTF8() should take advantage of the ASCII check in convertUTF8ToUTF16()
1590 https://bugs.webkit.org/show_bug.cgi?id=100577
1592 Reviewed by Oliver Hunt.
1594 Passed in ASCII flag to convertUTF8ToUTF16() and if try, create an 8 bit string from the original arguments.
1595 Relanding after fix to https://bugs.webkit.org/show_bug.cgi?id=102482.
1597 * wtf/text/WTFString.cpp:
1598 (WTF::String::fromUTF8):
1600 2012-11-15 Yury Semikhatsky <yurys@chromium.org>
1602 Memory instrumentation: add code for reporting stack traces of unknown instrumented objects
1603 https://bugs.webkit.org/show_bug.cgi?id=102384
1605 Reviewed by Pavel Feldman.
1607 Added an option to collect stack traces for instrumented pointers so that they
1608 can be printed in case the check failed for the pointer. This code is hidden
1611 * wtf/MemoryInstrumentation.h:
1612 (MemoryInstrumentationClient):
1613 (WTF::MemoryInstrumentation::checkCountedObject): the method now returns false
1614 in case the check has failed.
1615 (InstrumentedPointer):
1616 (WTF::::InstrumentedPointer):
1620 2012-11-15 Mark Hahnenberg <mhahnenberg@apple.com>
1622 Windows Fibers can corrupt the cached StackBounds
1623 https://bugs.webkit.org/show_bug.cgi?id=102411
1625 Reviewed by Geoffrey Garen.
1627 Windows has support for something called fibers, which are like lightweight versions of
1628 threads. Multiple fibers can run within the context of a single thread and they have access
1629 to the same thread local storage but have different stacks. If we create a new JSGlobalContext
1630 on one fiber, then switch to another fiber and create a JSGlobalContext there, we will call
1631 initializeThreading() once for each new JSGlobalContext created. However, since these fibers
1632 are technically running inside the same thread, they will clobber each other's wtfThreadData(),
1633 which is stored using thread local storage. This can lead to corruption of the WTFThreadData
1634 structure for the fibers other than the last one to create a new JSGlobalContext, including
1635 the StackBounds data structure which is used during conservative scanning, among other things.
1636 This can lead to crashes during garbage collection on Windows if fibers are used.
1638 A quick fix would be to always get a fresh StackBounds data structure when asking for it
1639 instead of using the cached version from the thread local storage. There is a larger problem
1640 in that these fibers can corrupt other WebKit data that uses thread local storage. We'll leave
1641 those theoretical fixes for future theoretical bugs.
1643 * wtf/WTFThreadData.h:
1644 (WTF::WTFThreadData::stack): We now refresh the m_stackBounds field whenever somebody asks for
1647 2012-11-15 Maciej Stachowiak <mjs@apple.com>
1649 Fix an erroneous comment about the operators required by binarySearch
1650 https://bugs.webkit.org/show_bug.cgi?id=102406
1652 Reviewed by Anders Carlsson.
1654 * wtf/StdLibExtras.h: binarySearch needs '==' and '<', not '--', '<' and '>'.
1656 2012-11-14 Michael Saboff <msaboff@apple.com>
1658 String::append() should handle two 8 bit strings without converting both to 16 bits
1659 https://bugs.webkit.org/show_bug.cgi?id=102286
1661 Reviewed by Oliver Hunt.
1663 If both strings are 8 bit, then allocate and copy to a new 8 bit string. Since most strings are
1664 8 bit, this will save up to 3x the resulting string length in bytes. 2x is due to the possible
1665 surviving 16 bit source string upconversion and 1x for the 16 bit result now being 8 bit.
1667 * wtf/text/WTFString.cpp:
1668 (WTF::String::append):
1670 2012-11-14 Csaba Osztrogonác <ossy@webkit.org>
1672 [Qt][ARM] Enable the DFG JIT on ARMv7(Thumb2)
1673 https://bugs.webkit.org/show_bug.cgi?id=101747
1675 Reviewed by Simon Hausmann.
1679 2012-11-13 Christophe Dumez <christophe.dumez@intel.com>
1681 Use prefix form of increment / decrement operators in WTF String classes when possible
1682 https://bugs.webkit.org/show_bug.cgi?id=101859
1684 Reviewed by Benjamin Poulain.
1686 Use prefix form of increment / decrement operators whenever possible in
1687 WTF String classes as this seems to be the convention in WebKit.
1689 * wtf/text/ASCIIFastPath.h:
1690 (WTF::copyLCharsFromUCharSource):
1691 * wtf/text/AtomicString.cpp:
1692 (WTF::AtomicString::add):
1693 * wtf/text/Base64.cpp:
1694 (WTF::base64Encode):
1695 (WTF::base64DecodeInternal):
1696 * wtf/text/StringBuilder.cpp:
1697 (WTF::StringBuilder::allocateBufferUpConvert):
1698 * wtf/text/StringConcatenate.h:
1699 * wtf/text/StringImpl.cpp:
1700 (WTF::StringImpl::getData16SlowCase):
1701 (WTF::StringImpl::upconvertCharacters):
1702 (WTF::StringImpl::containsOnlyWhitespace):
1703 (WTF::StringImpl::lower):
1704 (WTF::StringImpl::upper):
1705 (WTF::StringImpl::foldCase):
1706 (WTF::StringImpl::stripMatchedCharacters):
1707 (WTF::StringImpl::removeCharacters):
1708 (WTF::StringImpl::simplifyMatchedCharactersToSpace):
1709 (WTF::reverseFindInner):
1710 (WTF::reverseFindIgnoringCaseInner):
1711 (WTF::StringImpl::replace):
1712 (WTF::StringImpl::createWithTerminatingNullCharacter):
1713 * wtf/text/StringImpl.h:
1714 (WTF::codePointCompare):
1715 * wtf/text/WTFString.cpp:
1716 (WTF::String::String):
1717 (WTF::toIntegralType):
1719 2012-11-13 Ryosuke Niwa <rniwa@webkit.org>
1721 Build fix after r134490.
1723 * wtf/FastMalloc.cpp:
1725 2012-11-13 Brent Fulgham <bfulgham@webkit.org> and Alex Christensen <alex.christensen@flexsim.com>
1727 Fix FastMalloc.cpp compile error for MSVC in 64-bit.
1728 https://bugs.webkit.org/show_bug.cgi?id=88344
1730 Reviewed by Ryosuke Niwa.
1732 MSVC will not compile array declarations of zero size. The existing
1733 padding math for TCMalloc_Central_FreeListPadded would evaluate
1734 to zero on 64-bit machines, preventing the compile from finishing.
1736 * wtf/FastMalloc.cpp:
1737 (TCMalloc_Central_FreeListPadded_Template): Add new template (and
1738 zero-size specialization) to provide proper behavior under 64-bit
1741 2012-11-13 Brent Fulgham <bfulgham@webkit.org> and Alex Christensen <alex.christensen@flexsim.com>
1743 FastMalloc.cpp needs to be reordered before padding bug can be fixed
1744 https://bugs.webkit.org/show_bug.cgi?id=89366
1746 Note: This file violates Style rules. This change only moves
1747 the TCMalloc_Central_FreeList class declaration and the various
1748 FastMallocZone methods earlier in the file.
1750 Reviewed by Ryosuke Niwa.
1752 * wtf/FastMalloc.cpp:
1753 Reordered definitions to prepare for adding specialized template
1755 (TCMalloc_Central_FreeList):
1756 (WTF::TCMalloc_Central_FreeList::length):
1757 (WTF::TCMalloc_Central_FreeList::tc_length):
1758 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects):
1759 (TCMalloc_Central_FreeListPadded):
1761 (WTF::FastMallocZone::goodSize):
1762 (WTF::FastMallocZone::check):
1763 (WTF::FastMallocZone::print):
1764 (WTF::FastMallocZone::log):
1765 (WTF::FastMallocZone::forceLock):
1766 (WTF::FastMallocZone::forceUnlock):
1767 (WTF::FastMallocZone::statistics):
1768 (WTF::FastMallocZone::zoneValloc):
1769 (WTF::FastMallocZone::zoneDestroy):
1770 (WTF::KernelSupportsTLS):
1771 (WTF::CheckIfKernelSupportsTLS):
1772 (TCMalloc_ThreadCache):
1774 2012-11-11 Kenichi Ishibashi <bashi@chromium.org>
1776 WTFString::utf8() should have a mode of conversion to use replacement character
1777 https://bugs.webkit.org/show_bug.cgi?id=101678
1779 Reviewed by Alexander Pavlov.
1781 Introduce conversion mode to String::utf8().
1782 There are three conversion modes; lenient mode, strict mode, and
1783 "replacing unpaired surrogates with the replacement character" (replacement) mode.
1784 Lenient mode converts unpaired surrogates. Strict mode fails when there is an unpaired
1785 surrogates and returns CString(). Replacement mode replaces unpaired surrogates with
1786 the replacement character(U+FFFD). Replacement mode implements the algorithm defined at
1787 http://dev.w3.org/2006/webapi/WebIDL/#dfn-obtain-unicode. WebSocket::send() requires
1788 this algorithm to encode a string to utf-8.
1790 * wtf/text/WTFString.cpp:
1791 (WTF::String::utf8): Changed to take ConversionMode as the argument.
1792 * wtf/text/WTFString.h:
1795 2012-11-09 Alexei Filippov <alph@chromium.org>
1797 Web Inspector: Fix heap snapshots counted several times by NMI
1798 https://bugs.webkit.org/show_bug.cgi?id=101085
1800 The fix moves snapshots size counting to V8PerIsolateData class. As long
1801 as it has one instance per isolate its reportMemoryUsage should be
1802 called once per isolate.
1804 Reviewed by Yury Semikhatsky.
1806 * wtf/MemoryInstrumentation.h:
1807 (WTF::MemoryClassInfo::addPrivateBuffer):
1809 2012-11-08 Michael Saboff <msaboff@apple.com>
1811 HashAndUTF8CharactersTranslator should create an 8 bit string if possible
1812 https://bugs.webkit.org/show_bug.cgi?id=101515
1814 Reviewed by Darin Adler.
1816 Added isAllASCII flag that's passed to convertUTF8ToUTF16(). If on return it is true, create an
1817 8 bit string, otherwise use the 16 bit string.
1819 * wtf/text/AtomicString.cpp:
1820 (WTF::HashAndUTF8CharactersTranslator::translate):
1822 2012-11-08 Simon Hausmann <simon.hausmann@digia.com>
1824 [Qt] Fix build with MSVC 2012 and Angle
1825 https://bugs.webkit.org/show_bug.cgi?id=101588
1827 Reviewed by Tor Arne Vestbø.
1829 Angle includes STL's <memory> header file, which with MSVC 2012 includes stdint.h. MSVC 2012
1830 does ship stdint.h, but it's lacking other headers such as inttypes.h.
1832 So for the rest of WebKit we have to continue to use our own versions of these files from
1833 JavaScriptCore/os-win32. But for Angle we are just including a shipped STL header file (memory)
1834 and so it's up to the compiler to make that work, i.e. using the stdint.h it ships.
1836 This patch moves the addition of JavaScriptCore/os-win32 out of default_post.prf, so that it
1837 doesn't apply to each and every target anymore. In particular it won't apply to Angle anymore,
1838 because its presence causes a build issue where due to the addition of os-win32/ we end up
1839 including our own stdint.h but are lacking WTF/ to be in the include search path (which our own
1840 stdint.h requires). So out of default_post.prf and into WTF.pri, our own wrappers are now only
1841 used where WTF is also needed, and since os-win32/stdint.h depends on wtf/Platform.h, it seems
1842 like a logical location.
1846 2012-11-07 Hans Wennborg <hans@chromium.org>
1848 Fix asm operand type for weakCompareAndSwap on ARM_THUMB2
1849 https://bugs.webkit.org/show_bug.cgi?id=101238
1851 Reviewed by Benjamin Poulain.
1853 'result' was a bool, but the asm was expecting a 32-bit register. A
1854 recent version of Clang warned about this:
1856 WebKit/Source/WTF/wtf/Atomics.h:163:34: error: the size being stored
1857 is truncated, use a modifier to specify the size [-Werror,-Wasm-operand-widths]
1859 This patch fixes it by making 'result' an unsigned. It does not change
1860 the functionality in practice ('result' would be in a 32-bit register
1861 anyway), but it makes the code more correct and makes the warning go
1864 Also make 'result' for the X86 version an 'unsigned char' to make it
1865 more clear that it is a byte.
1868 (WTF::weakCompareAndSwap):
1870 2012-11-07 Remy Demarest <rdemarest@apple.com>
1872 Function adoptNS and adoptCF should not generate memory leak diagnostic with Clang Static Analyzer.
1873 https://bugs.webkit.org/show_bug.cgi?id=101420
1875 Reviewed by Benjamin Poulain.
1877 Add attributes to the adoptNS and adoptCF function arguments to remove Clang Static Analyzer diagnotics.
1878 Define CF_RELEASES_ARGUMENT and NS_RELEASES_ARGUMENT if not available, use them in function declarations.
1881 (WTF::adoptCF): Adds CF_RELEASES_ARGUMENT attribute to the argument.
1882 (WTF::adoptNS): Adds NS_RELEASES_ARGUMENT attribute to the argument.
1884 2012-11-07 Christophe Dumez <christophe.dumez@intel.com>
1886 Add replaceWithLiteral() method to WTF::String
1887 https://bugs.webkit.org/show_bug.cgi?id=101257
1889 Reviewed by Benjamin Poulain.
1891 Add replaceWithLiteral() method to WTF::String that takes
1892 replacement string as a literal to avoid uselessly constructing
1895 * wtf/text/StringImpl.cpp:
1896 (WTF::StringImpl::replace):
1898 * wtf/text/StringImpl.h:
1899 (WTF::StringImpl::replace):
1901 * wtf/text/WTFString.h:
1903 (WTF::String::replaceWithLiteral):
1905 2012-11-06 Michael Saboff <msaboff@apple.com>
1907 StringBuilder::append(UChar) with an 8 bit quantity shouldn't change the contents to 16 bits
1908 https://bugs.webkit.org/show_bug.cgi?id=101421
1910 Reviewed by Anders Carlsson.
1912 If the string builder contains only 8 bit data, check if the character being appended contains
1913 8 bit data. If so, append it to the 8 bit buffer instead of converting the buffer to 16 bits.
1915 * wtf/text/StringBuilder.cpp:
1916 (WTF::StringBuilder::append):
1917 * wtf/text/StringBuilder.h:
1918 (WTF::StringBuilder::append):
1920 2012-11-06 Benjamin Poulain <benjamin@webkit.org>
1922 Speed up TransformationMatrix::multiply() on modern ARM
1923 https://bugs.webkit.org/show_bug.cgi?id=101084
1925 Reviewed by Gavin Barraclough.
1928 Add CPU(ARM_VFP) for detecting VFP availability.
1929 Add CPU(APPLE_ARMV7S) for the Apple ARMv7S architecture.
1931 2012-11-06 Laszlo Gombos <l.gombos@samsung.com>
1933 Refactor setting TEXTURE_MAPPER_GL
1934 https://bugs.webkit.org/show_bug.cgi?id=99758
1936 Reviewed by Noam Rosenthal.
1938 Make the rule that sets the default for USE(3D_GRAPHICS) port independent.
1940 If not set, set USE(TEXTURE_MAPPER_GL) when USE(TEXTURE_MAPPER) and
1941 USE(3D_GRAPHICS) is enabled.
1945 2012-11-05 Philip Rogers <pdr@google.com>
1947 Unblock SVG external references
1948 https://bugs.webkit.org/show_bug.cgi?id=100635
1950 Reviewed by Adam Barth.
1952 This patch reverts r132849 and r132869 because the potential XSS issue
1953 turned out to not be an issue after all.
1955 Covered by existing tests, many of which are re-whitelisted with this patch.
1959 2012-11-05 Dima Gorbik <dgorbik@apple.com>
1961 Back out controversial changes from Bug 98665.
1962 https://bugs.webkit.org/show_bug.cgi?id=101244
1964 Reviewed by David Kilzer.
1966 Backing out changes from Bug 98665 until further discussions take place on rules for including Platform.h in Assertions.h.
1970 2012-11-03 Alexey Proskuryakov <ap@apple.com>
1972 Get rid of USE(CFURLSTORAGESESSIONS)
1973 https://bugs.webkit.org/show_bug.cgi?id=101131
1975 Reviewed by Sam Weinig.
1979 2012-11-02 Ilya Tikhonovsky <loislo@chromium.org>
1981 Web Inspector: NMI instrument NodeRareData::Map. It uses ~250k on nytimes.com
1982 https://bugs.webkit.org/show_bug.cgi?id=101052
1984 Reviewed by Yury Semikhatsky.
1986 I noticed that in many cases cache structures are plain static HashMap, HashSet etc.
1987 MemoryAgent can visit it but instrumentation for these containers report no objectType.
1988 It means that addRootObject method needs to accept objectType property as an argument.
1989 Otherwise I would have had to create a proxy class with proper objectType.
1991 * wtf/MemoryInstrumentation.h:
1992 (WTF::MemoryInstrumentation::addRootObject):
1994 2012-11-01 Kent Tamura <tkent@chromium.org>
1996 Introduce ENABLE_DATE_AND_TIME_INPUT_TYPES, and clarify usage of other related flags
1997 https://bugs.webkit.org/show_bug.cgi?id=101007
1999 Reviewed by Kentaro Hara.
2002 Add ENABLE_DATE_AND_TIME_INPUT_TYPES. It's a union of
2003 ENABLE_INPUT_TYPE_{DATE,DATETIME,DATETIMELOCAL,MONTH,TIME,WEEK}.
2005 2012-11-01 Yury Semikhatsky <yurys@chromium.org>
2007 Memory instrumentation: do not call checkCountedObject with wrong pointers
2008 https://bugs.webkit.org/show_bug.cgi?id=100958
2010 Reviewed by Alexander Pavlov.
2012 Removed calls to checkCountedObject from places where the pointer may contain
2013 an address of a base class which may differ from the actual object pointer. Instead
2014 checkCountedObject is only called right after processing deferred pointer where
2015 we know real address.
2017 * wtf/MemoryInstrumentation.h:
2018 (WTF::MemoryInstrumentation::addObjectImpl):
2021 2012-11-01 Alexey Proskuryakov <ap@apple.com>
2023 Rename HAVE(NETWORK_CFDATA_ARRAY_CALLBACK) to USE(NETWORK_CFDATA_ARRAY_CALLBACK)
2025 Rubber-stamped by Joe Pecoraro.
2027 All CFNetwork based platforms have this now, but not all use it at the moment.
2029 2012-11-01 Alexey Proskuryakov <ap@apple.com>
2031 Fix HAVE(NETWORK_CFDATA_ARRAY_CALLBACK) build
2032 https://bugs.webkit.org/show_bug.cgi?id=100979
2034 Reviewed by Joseph Pecoraro.
2036 * wtf/Platform.h: Added a FIXME about HAVE(NETWORK_CFDATA_ARRAY_CALLBACK).
2038 2012-11-01 Yury Semikhatsky <yurys@chromium.org>
2040 Memory instrumentation: report memory occupied by ResourceRequest instead of its base ResourceRequestBase
2041 https://bugs.webkit.org/show_bug.cgi?id=100497
2043 Reviewed by Alexander Pavlov.
2045 * wtf/MemoryInstrumentation.h:
2046 (WTF::MemoryClassInfo::addPrivateBuffer): do not report memory usage for empty buffer.
2048 2012-10-31 Anders Carlsson <andersca@apple.com>
2051 <rdar://problem/12612207>.
2053 Reviewed by Sam Weinig.
2055 * wtf/CheckedArithmetic.h:
2057 2012-10-31 Benjamin Poulain <bpoulain@apple.com>
2059 Add an optimized version of copyLCharsFromUCharSource for ARM
2060 https://bugs.webkit.org/show_bug.cgi?id=94886
2062 Reviewed by Gavin Barraclough.
2064 Michael Saboff added a SIMD version of copyLCharsFromUCharSource() in r125846.
2066 This patch a similar optimization for ARMv7 by using the interleaved load/store available
2067 in the NEON extension.
2069 The performance gains:
2070 -10000 characters: ~3.5 times faster.
2071 -20 characters (2 vectors): ~55% faster.
2072 -15 characters (1 vector): ~21% faster.
2073 -3 characters (no vector, pure overhead): ~10% slower.
2075 * wtf/text/ASCIIFastPath.h:
2076 (WTF::copyLCharsFromUCharSource):
2078 2012-10-31 Christophe Dumez <christophe.dumez@intel.com>
2080 [EFL][WK2][AC] Use smart pointers for Evas_GL types
2081 https://bugs.webkit.org/show_bug.cgi?id=100745
2083 Reviewed by Kenneth Rohde Christiansen.
2085 Make OwnPtr usable with Evas_GL type to avoid handling
2086 raw pointers in EFL port.
2088 * wtf/OwnPtrCommon.h:
2090 * wtf/efl/OwnPtrEfl.cpp:
2092 (WTF::deleteOwnedPtr):
2094 2012-10-29 Anders Carlsson <andersca@apple.com>
2096 Build WebKit as C++11 on Mac
2097 https://bugs.webkit.org/show_bug.cgi?id=100720
2099 Reviewed by Daniel Bates.
2101 * Configurations/Base.xcconfig:
2102 Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
2104 * wtf/text/AtomicString.cpp:
2105 (WTF::AtomicString::add):
2106 Change the type of length to be unsigned to prevent implicit type conversions in non-constant initializer lists.
2108 * wtf/unicode/UTF8.cpp:
2110 Add static_casts to prevent implicit type conversions in non-constant initializer lists.
2112 2012-10-29 Anders Carlsson <andersca@apple.com>
2114 String::createCFString should return a RetainPtr
2115 https://bugs.webkit.org/show_bug.cgi?id=100419
2117 Reviewed by Andreas Kling.
2119 Make String::createCFString and StringImpl::createCFString return RetainPtrs.
2121 * wtf/text/AtomicString.h:
2122 * wtf/text/StringImpl.h:
2123 * wtf/text/WTFString.h:
2125 2012-10-30 Mark Rowe <mrowe@apple.com>
2127 Fix WTF to not install a few header files in bogus locations.
2129 * WTF.xcodeproj/project.pbxproj:
2131 2012-10-28 Mark Rowe <mrowe@apple.com>
2133 Simplify Xcode configuration settings that used to vary between OS versions.
2135 Reviewed by Dan Bernstein.
2137 * Configurations/Base.xcconfig:
2138 * Configurations/DebugRelease.xcconfig:
2140 2012-10-28 Mark Rowe <mrowe@apple.com>
2142 Remove references to unsupported OS and Xcode versions.
2144 Reviewed by Anders Carlsson.
2146 * Configurations/Base.xcconfig:
2147 * Configurations/CompilerVersion.xcconfig: Removed.
2148 * Configurations/DebugRelease.xcconfig:
2149 * WTF.xcodeproj/project.pbxproj:
2151 2012-10-29 Anders Carlsson <andersca@apple.com>
2153 AtomicString(CFStringRef) shouldn't unconditionally create a StringImpl
2154 https://bugs.webkit.org/show_bug.cgi?id=100701
2156 Reviewed by Dan Bernstein.
2158 * wtf/text/AtomicString.h:
2159 (WTF::AtomicString::AtomicString):
2160 Change the constructors that take a CFStringRef and an NSString * to call AtomicString::add(CFStringRef)
2161 and remove AtomicString::createCFString.
2163 (WTF::AtomicString::add):
2164 Add new member function declaration. The definition is in a new file in WebCore, AtomicStringCF.cpp.
2165 Also, fix the overload of add that takes a const char* to call the right other overload instead of itself.
2167 2012-10-29 Adam Barth <abarth@webkit.org>
2169 Unreviewed. Correct my previous patch to disable external SVG
2170 references only on PLATFORM(CHROMIUM).
2174 2012-10-29 Adam Barth <abarth@webkit.org>
2176 Block SVG external references pending a security review
2177 https://bugs.webkit.org/show_bug.cgi?id=100635
2179 Reviewed by Eric Seidel.
2181 We need to do a security review of loading external SVG references
2182 before we're sure that it is safe.
2186 2012-10-29 Michael Saboff <msaboff@apple.com>
2188 String::split(UChar, Vector<String>&) shouldn't create a temporary String
2189 https://bugs.webkit.org/show_bug.cgi?id=100578
2191 Reviewed by Anders Carlsson.
2193 Changed split(UChar, Vector<String>&) to call split(UChar, bool, Vector<String>&) instead of creating a
2194 string and calling the split(String,...) version and moved it to WTFString.h. Also moved
2195 split(const String& separator, Vector<String>& result) to WTFString.h.
2197 * wtf/text/WTFString.cpp:
2198 (WTF::String::split):
2199 * wtf/text/WTFString.h:
2200 (WTF::String::split):
2202 2012-10-29 Sheriff Bot <webkit.review.bot@gmail.com>
2204 Unreviewed, rolling out r132736.
2205 http://trac.webkit.org/changeset/132736
2206 https://bugs.webkit.org/show_bug.cgi?id=100652
2208 It broke all plugin related tests on GTK and on Qt (Requested
2209 by Ossy on #webkit).
2211 * wtf/text/WTFString.cpp:
2212 (WTF::String::fromUTF8):
2214 2012-10-27 Michael Saboff <msaboff@apple.com>
2216 Try to create AtomicString as 8 bit where possible
2217 https://bugs.webkit.org/show_bug.cgi?id=100575
2219 Reviewed by Oliver Hunt.
2221 Added StringImpl::create8BitIfPossible() that first tries to create an 8 bit string. If it finds a 16 bit character
2222 during processing, it calls the standard create() method. The assumption is that this will be used on mostly 8 bit
2223 strings and ones that are shorter (in the tens of characters). Changed AtomicString to use the new creation method
2224 for UChar based construction.
2226 * wtf/text/AtomicString.cpp:
2227 (WTF::UCharBufferTranslator::translate):
2228 * wtf/text/StringImpl.cpp:
2229 (WTF::StringImpl::create8BitIfPossible):
2230 * wtf/text/StringImpl.h:
2231 (WTF::StringImpl::create8BitIfPossible):
2233 2012-10-27 Michael Saboff <msaboff@apple.com>
2235 String::fromUTF8() should take advantage of the ASCII check in convertUTF8ToUTF16()
2236 https://bugs.webkit.org/show_bug.cgi?id=100577
2238 Reviewed by Oliver Hunt.
2240 Passed is ASCII flag to convertUTF8ToUTF16() and if try, create an 8 bit string from the original arguments.
2242 * wtf/text/WTFString.cpp:
2243 (WTF::String::fromUTF8):
2245 2012-10-27 Dan Bernstein <mitz@apple.com>
2247 REAL_PLATFORM_NAME build setting is no longer needed
2248 https://bugs.webkit.org/show_bug.cgi?id=100587
2250 Reviewed by Mark Rowe.
2252 Removed the definition of REAL_PLATFORM_NAME and replaced references to it with references
2255 * Configurations/Base.xcconfig:
2256 * Configurations/CompilerVersion.xcconfig:
2257 * Configurations/DebugRelease.xcconfig:
2259 2012-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
2261 Unreviewed, rolling out r132689.
2262 http://trac.webkit.org/changeset/132689
2263 https://bugs.webkit.org/show_bug.cgi?id=100574
2265 Broke HashMaps containing RetainPtrs (Requested by andersca on
2270 2012-10-26 Anders Carlsson <andersca@apple.com>
2272 Add an operator& to RetainPtr
2273 https://bugs.webkit.org/show_bug.cgi?id=100549
2275 Reviewed by Dan Bernstein.
2277 This is useful for APIs that return references using out parameters.
2280 (WTF::RetainPtr::operator&):
2282 2012-10-26 Gabor Ballabas <gaborb@inf.u-szeged.hu>
2284 [Qt] Enable JSC's disassembler on x86, x86_64 Linux
2285 https://bugs.webkit.org/show_bug.cgi?id=100386
2287 Reviewed by Simon Hausmann.
2289 It works fine on Linux x86, x86_64 just needs to be enabled in the
2290 QtWebKit build system.
2294 2012-10-25 Michael Saboff <msaboff@apple.com>
2296 REGRESSION (r131836): failures in list styles tests on EFL, GTK
2297 https://bugs.webkit.org/show_bug.cgi?id=99824
2299 Reviewed by Oliver Hunt.
2302 Added placeholder argument for new argument added to convertUTF8ToUTF16() in http://trac.webkit.org/changeset/131836.
2304 * wtf/unicode/UTF8.cpp:
2305 (WTF::Unicode::convertUTF8ToUTF16):
2306 * wtf/unicode/glib/UnicodeGLib.cpp:
2307 (WTF::Unicode::convertCase):
2309 2012-10-25 Christophe Dumez <christophe.dumez@intel.com>
2311 [EFL][WK2] Remove some C'ism from EwkView
2312 https://bugs.webkit.org/show_bug.cgi?id=100370
2314 Reviewed by Kenneth Rohde Christiansen.
2316 Make OwnPtr useable for Ecore_IMF_Context to avoid
2317 using raw pointers in EFL port.
2319 * wtf/OwnPtrCommon.h:
2321 * wtf/PlatformEfl.cmake:
2322 * wtf/efl/OwnPtrEfl.cpp:
2323 (WTF::deleteOwnedPtr):
2326 2012-09-27 Yury Semikhatsky <yurys@chromium.org>
2328 Web Inspector: provide memory instrumentation for ListHashSet
2329 https://bugs.webkit.org/show_bug.cgi?id=97786
2331 Reviewed by Vsevolod Vlasov.
2333 Added memory instrumentation for ListHashSet.
2335 * GNUmakefile.list.am:
2338 * WTF.vcproj/WTF.vcproj:
2339 * WTF.xcodeproj/project.pbxproj:
2342 * wtf/ListHashSet.h:
2344 (ListHashSetNodeAllocator): changed visibility of inPool method to public
2345 (WTF::ListHashSetNodeAllocator::pool):
2346 (WTF::ListHashSetNodeAllocator::pastPool):
2347 (WTF::::sizeInBytes): added a method that returns size of the set in bytes including
2348 all its internals but not the content elements.
2350 * wtf/MemoryInstrumentation.h: removed onsolete method. All clients were updated to
2351 use generic addMember instead.
2352 (MemoryInstrumentation):
2353 (WTF::MemoryClassInfo::addPrivateBuffer):
2354 * wtf/MemoryInstrumentationHashSet.h:
2355 * wtf/MemoryInstrumentationListHashSet.h: Copied from Source/WTF/wtf/MemoryInstrumentationHashSet.h.
2357 (WTF::reportMemoryUsage):
2359 2012-10-23 Benjamin Poulain <benjamin@webkit.org>
2361 WTFURL: Implement KURL::setPort()
2362 https://bugs.webkit.org/show_bug.cgi?id=99898
2364 Reviewed by Adam Barth.
2366 Add an efficient implementation for remplacing the port component
2367 in an URL. This will be the base for replacing other components
2370 The testing is covered by fast/dom/HTMLAnchorElement/set-href-attribute-port.html
2372 * wtf/url/api/ParsedURL.cpp:
2373 (WTF::generateNewSpecWithPort):
2374 (WTF::replacePortWithString):
2375 (WTF::ParsedURL::replacePort):
2376 * wtf/url/api/ParsedURL.h:
2379 2012-10-22 Michael Saboff <msaboff@apple.com>
2381 Regression(r131655): Crash in StringImpl::findIgnoringCase
2382 https://bugs.webkit.org/show_bug.cgi?id=99753
2384 Reviewed by Geoffrey Garen.
2386 Fixed to use the searchLength to take into account the start index.
2388 Added LayoutTests/fast/js/find-ignoring-case-regress-99753.html
2390 * wtf/text/StringImpl.cpp:
2391 (WTF::StringImpl::findIgnoringCase):
2393 2012-10-22 Simon Hausmann <simon.hausmann@digia.com>
2395 Unreviewed: Re-enable LLINT on Qt/Linux after r131932.
2399 2012-10-22 Yury Semikhatsky <yurys@chromium.org>
2401 Web Inspector: do not double count memory of objects with multiple ancestors
2402 https://bugs.webkit.org/show_bug.cgi?id=99958
2404 Reviewed by Alexander Pavlov.
2406 Make sure memory occupied by objects of classes with multiple inheritance is
2409 * wtf/MemoryInstrumentation.h:
2410 (WTF::MemoryObjectInfo::MemoryObjectInfo):
2411 (WTF::MemoryObjectInfo::reportedPointer):
2412 (WTF::MemoryObjectInfo::reportObjectInfo): 1) Store actual pointer to the instrumented
2413 object as it may differ from the original pointer by which it was reported. 2) Make
2414 the method non-template and calculate object size on the caller side.
2416 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
2417 (WTF::MemoryClassInfo::MemoryClassInfo):
2418 (WTF::MemoryInstrumentation::InstrumentedPointer::process): use adjusted pointer
2419 returned by reportMemoryUsage to check if the object has already been visited when
2420 the pointer differs from the orinal one(it may happen if the object was reported
2421 by a pointer to one of its base classes).
2423 2012-10-20 Martin Robinson <mrobinson@igalia.com>
2425 Fix 'make dist' for the GTK+ port
2427 * GNUmakefile.list.am: Add missing files to the source list.
2429 2012-10-19 Mark Lam <mark.lam@apple.com>
2431 Added WTF::StackStats mechanism.
2432 https://bugs.webkit.org/show_bug.cgi?id=99805.
2434 Reviewed by Geoffrey Garen.
2436 Disabled by default. Should have no performance and memory cost when
2437 disabled. To enable, #define ENABLE_STACK_STATS 1 in StackStats.h.
2438 The output is currently hardcoded to be dumped in /tmp/stack-stats.log,
2439 and is in the form of stack sample events. By default, it only logs
2440 a sample event when a new high watermark value is encountered.
2442 Also renamed StackBounds::recursiveCheck() to isSafeToRecurse().
2444 * WTF.xcodeproj/project.pbxproj:
2445 * wtf/StackBounds.h:
2447 (WTF::StackBounds::size):
2448 (WTF::StackBounds::isSafeToRecurse):
2449 * wtf/StackStats.cpp: Added.
2451 (WTF::StackStats::initialize):
2452 (WTF::StackStats::PerThreadStats::PerThreadStats):
2453 (WTF::StackStats::CheckPoint::CheckPoint):
2454 (WTF::StackStats::CheckPoint::~CheckPoint):
2455 (WTF::StackStats::probe):
2456 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
2457 (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
2458 * wtf/StackStats.h: Added.
2462 (WTF::StackStats::CheckPoint::CheckPoint):
2464 (WTF::StackStats::PerThreadStats::PerThreadStats):
2466 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
2467 (WTF::StackStats::initialize):
2468 (WTF::StackStats::probe):
2469 * wtf/ThreadingPthreads.cpp:
2470 (WTF::initializeThreading):
2471 * wtf/WTFThreadData.cpp:
2472 (WTF::WTFThreadData::WTFThreadData):
2473 * wtf/WTFThreadData.h:
2475 (WTF::WTFThreadData::stackStats):
2477 2012-10-19 Anders Carlsson <andersca@apple.com>
2479 Deque can use std::reverse_iterator for its reverse iterators
2480 https://bugs.webkit.org/show_bug.cgi?id=99789
2482 Reviewed by Andreas Kling.
2484 Remove DequeReverseIterator and DequeConstReverseIterator and just use std::reverse_iterator directly.
2485 Also, remove the DequeIteratorBase<T, inlineCapacity> to Base typedef - We can already use DequeIteratorBase since it's
2486 equivalent to the full class template type.
2489 (WTF::Deque::rbegin):
2491 (DequeIteratorBase):
2492 (WTF::DequeIteratorBase::assign):
2494 (DequeConstIterator):
2495 (WTF::::checkValidity):
2496 (WTF::::DequeIteratorBase):
2500 2012-10-19 Csaba Osztrogonác <ossy@webkit.org>
2502 Unreviewed buildfix, use C-style comment instead of C++
2506 2012-10-19 Csaba Osztrogonác <ossy@webkit.org>
2508 REGRESSION(r131822): It made 500+ tests crash on 32 bit platforms
2509 https://bugs.webkit.org/show_bug.cgi?id=99814
2511 Reviewed by Simon Hausmann.
2513 * wtf/Platform.h: Disable LLINT on (PLATFORM(QT) && CPU(X86)) temporarily until proper fix.
2515 2012-10-17 Ilya Tikhonovsky <loislo@chromium.org>
2517 Web Inspector: NMI provide data for mixing with tcmalloc heap dumps.
2518 https://bugs.webkit.org/show_bug.cgi?id=99457
2520 Reviewed by Yury Semikhatsky.
2522 countObjectSize now accepts ptr as the first argument and saves it into HashMap if the binary was ran with HEAPPROFILE env variable.
2523 getProcessMemoryDistribution does snapshot and calls the downstream code with the map of counted objects.
2525 * wtf/MemoryInstrumentation.h:
2526 (MemoryInstrumentationClient):
2527 (WTF::MemoryInstrumentation::countObjectSize):
2528 (WTF::MemoryInstrumentation::addRawBuffer):
2529 (WTF::MemoryClassInfo::addPrivateBuffer):
2530 (WTF::MemoryInstrumentation::addObjectImpl):
2531 (WTF::MemoryInstrumentation::addListHashSet):
2534 2012-10-18 Michael Saboff <msaboff@apple.com>
2536 convertUTF8ToUTF16() Should Check for ASCII Input
2537 ihttps://bugs.webkit.org/show_bug.cgi?id=99739
2539 Reviewed by Geoffrey Garen.
2541 Added code to accumulate the "or" of all characters seen during the UTF8 to UTF16 conversion. This is
2542 used to check to see if all characters are ASCII and is returned via a bool*.
2544 * wtf/unicode/UTF8.cpp:
2545 (WTF::Unicode::convertUTF8ToUTF16):
2546 * wtf/unicode/UTF8.h:
2548 2012-10-18 Michael Saboff <msaboff@apple.com>
2550 Mac WTF build checks dependencies before copying header files
2551 https://bugs.webkit.org/show_bug.cgi?id=99770
2553 Reviewed by Mark Rowe.
2555 Fixed up build rules per Mark Rowe. Made new target an Aggregate and removed "WTF copy".
2557 * Configurations/CopyWTFHeaders.xcconfig: Added.
2558 * Configurations/WTF.xcconfig:
2559 * WTF.xcodeproj/project.pbxproj:
2561 2012-10-18 Michael Saboff <msaboff@apple.com>
2563 Mac WTF build checks dependencies before copying header files
2564 https://bugs.webkit.org/show_bug.cgi?id=99770
2566 Reviewed by Geoffrey Garen.
2568 Added a new build target "Copy WTF HEaders" to copy the header files and made that new target a dependency
2569 for the main WTF build target. Moved the "Copy WTF Headers" phase from WTF target to the new target.
2571 * WTF.xcodeproj/project.pbxproj:
2573 2012-10-17 Anders Carlsson <andersca@apple.com>
2576 https://bugs.webkit.org/show_bug.cgi?id=99622
2578 Reviewed by Benjamin Poulain.
2580 Remove unused member functions from Vector and get rid of the std::max and std::min using declarations
2581 (as per the WebKit coding style guidelines).
2583 * WTF.xcodeproj/project.pbxproj:
2584 Turns out StreamBuffer.h was never added to the Xcode project; add it. Also go ahead and sort the project file.
2587 (WTF::::expandCapacity):
2588 * wtf/StreamBuffer.h:
2589 (WTF::StreamBuffer::append):
2590 Add std:: prefixes to max and min.
2593 Remove VectorBase::bufferSlot(), VectorReverseProxy and add std:: prefixes where needed.
2595 2012-10-17 Michael Saboff <msaboff@apple.com>
2597 Creating a String from an NSString should check for all 8 bit strings
2598 https://bugs.webkit.org/show_bug.cgi?id=99392
2600 Reviewed by Geoffrey Garen.
2602 Exported the LChar* version of create().
2604 * wtf/text/StringImpl.cpp:
2605 (WTF::StringImpl::create):
2607 2012-10-17 Michael Saboff <msaboff@apple.com>
2609 StringImpl::findIgnoringCase() and reverseFindIgnoringCase() don't optimally handle a mix of 8 and 16 bit strings
2610 https://bugs.webkit.org/show_bug.cgi?id=99224
2612 Reviewed by Geoffrey Garen.
2614 Added helper templated functions and all four combinations similar to find() and reverseFind().
2616 (WTF::findIgnoringCaseInner):
2617 (WTF::StringImpl::findIgnoringCase):
2618 (WTF::reverseFindIgnoringCaseInner):
2619 (WTF::StringImpl::reverseFindIgnoringCase):
2621 2012-10-17 Michael Saboff <msaboff@apple.com>
2623 AtomicString::HashAndUTF8CharactersTranslator::equal() doesn't optimally handle 8 bit strings
2624 https://bugs.webkit.org/show_bug.cgi?id=99223
2626 Reviewed by Geoffrey Garen.
2628 Added an 8 bit path.
2630 * wtf/text/AtomicString.cpp:
2631 (WTF::HashAndUTF8CharactersTranslator::equal):
2633 2012-10-17 Anders Carlsson <andersca@apple.com>
2635 Always use fastRealloc when growing or shrinking the Vector buffer
2636 https://bugs.webkit.org/show_bug.cgi?id=99616
2638 Reviewed by Andreas Kling.
2640 Remove the pointless #if PLATFORM(BLACKBERRY) and always try to use fastRealloc to grow or shrink the
2641 vector buffer when possible; realloc should always be at least as fast as free+malloc.
2644 (WTF::VectorBufferBase::shouldReallocateBuffer):
2646 2012-10-16 Michael Saboff <msaboff@apple.com>
2648 Change WTF_USE_8BIT_TEXTRUN to ENABLE_8BIT_TEXTRUN
2649 https://bugs.webkit.org/show_bug.cgi?id=99484
2651 Reviewed by Eric Seidel.
2653 Changed macro name to align with it's purpose.
2657 2012-10-16 Michael Saboff <msaboff@apple.com>
2659 StringImpl::reverseFind() with a single match character isn't optimal for mixed 8/16 bit cases
2660 https://bugs.webkit.org/show_bug.cgi?id=99363
2662 Reviewed by Benjamin Poulain.
2664 Factored out the 8/16 bitness check of the match character from the subject character bitness
2665 check. Did this for both find() and reverseFind(). Added all UChar/LChar combinations to the
2666 inline reverseFind().
2668 * wtf/text/StringImpl.cpp:
2669 (WTF::StringImpl::find):
2670 (WTF::StringImpl::reverseFind):
2671 * wtf/text/StringImpl.h:
2674 2012-10-16 Dima Gorbik <dgorbik@apple.com>
2676 Remove Platform.h include from the header files.
2677 https://bugs.webkit.org/show_bug.cgi?id=98665
2679 Reviewed by Eric Seidel.
2681 We don't want other clients that include WebKit headers to know about Platform.h.
2686 2012-10-16 Adrienne Walker <enne@google.com>
2688 Remove unused WTF_NEW_HASHMAP_ITERATORS_INTERFACE #define
2689 https://bugs.webkit.org/show_bug.cgi?id=99367
2691 Reviewed by James Robinson.
2693 Does what it says on the tin.
2697 2012-10-15 Andreas Kling <kling@webkit.org>
2699 Remove WTF::fastDeleteAllValues().
2700 <http://webkit.org/b/99345>
2702 Reviewed by Eric Seidel.
2704 It was only used to fastDelete() a class that was already overriding operator delete
2705 by way of WTF_MAKE_FAST_ALLOCATED anyway.
2711 2012-10-15 Mark Hahnenberg <mhahnenberg@apple.com>
2713 Parallel GC should not be disabled for all platforms
2715 * wtf/Platform.h: D'oh!
2717 2012-10-15 George Staikos <staikos@webkit.org>
2719 [BlackBerry] Adapt to Platform API changes in string handling
2720 https://bugs.webkit.org/show_bug.cgi?id=99248
2722 Reviewed by Yong Li.
2724 Convert usage of WebString, char* and std::string to BlackBerry::Platform::String.
2726 * wtf/Assertions.cpp: Use proper log function.
2727 * wtf/text/AtomicString.h: Add BlackBerry support
2729 (WTF::AtomicString::AtomicString): Add BlackBerry Support
2730 (WTF::AtomicString::operator BlackBerry::Platform::String):
2731 * wtf/text/StringImpl.h: Conversion support.
2732 * wtf/text/WTFString.h: Conversion support.
2736 2012-10-15 Michael Saboff <msaboff@apple.com>
2738 Update RenderText to use String instead of UChar* for text
2739 https://bugs.webkit.org/show_bug.cgi?id=96979
2741 Reviewed by Dan Bernstein.
2743 Added WTF_USE_8BIT_TEXTRUN to encase code that creates 8 bit TextRun's. Enabled WTF_USE_8BIT_TEXTRUN
2744 for PLATFORM(MAC). Other platform can update this setting in Platform.h when their platform specific use of
2745 TextRun handle 8 bit data. Added a new Vector::appendVector to allow appending the contents of a vector
2746 containing one type to the end of vector containing another. This is used to append a Vector<LChar> to
2747 the end of a Vector<UChar>.
2752 (WTF::Vector::appendVector):
2754 2012-10-15 Ilya Tikhonovsky <loislo@chromium.org>
2756 Web Inspector: convert manual size calculation of different WebKit things into MemoryInstrumentation.
2757 https://bugs.webkit.org/show_bug.cgi?id=99309
2759 Reviewed by Yury Semikhatsky.
2761 JSHeap, DOMStorage and HeapProfiler data were counted manually.
2762 Now we count the sizes more generic way.
2764 * wtf/MemoryInstrumentation.h: calculateContainerSize were removed.
2765 * wtf/MemoryInstrumentationSequence.h: empty instrumentations were added for 'const char*' and 'const void*' sequences.
2767 2012-10-12 Anders Carlsson <andersca@apple.com>
2769 Move QDataStream functions into HistoryItemQt.cpp
2770 https://bugs.webkit.org/show_bug.cgi?id=99203
2772 Reviewed by Andreas Kling.
2774 It seems like the QDataStream stream operators are only used from HistoryItemQt.cpp
2775 inside WebCore, so move them there. If in the future they are required elsewhere, they should
2776 be moved into a separate header instead of polluting headers unnecessarily.
2779 * wtf/qt/StringQt.cpp:
2780 * wtf/text/WTFString.h:
2782 2012-10-12 Michael Saboff <msaboff@apple.com>
2784 StringBuilder::append(StringBuilder&) doesn't take into account the bit size of the argument string
2785 https://bugs.webkit.org/show_bug.cgi?id=99225
2787 Reviewed by Benjamin Poulain.
2791 * wtf/text/StringBuilder.h:
2792 (WTF::StringBuilder::append):
2794 2012-10-12 Sheriff Bot <webkit.review.bot@gmail.com>
2796 Unreviewed, rolling out r131224.
2797 http://trac.webkit.org/changeset/131224
2798 https://bugs.webkit.org/show_bug.cgi?id=99210
2800 It broke the build (Requested by andersca on #webkit).
2806 * wtf/qt/StringQt.cpp:
2810 * wtf/text/WTFString.h:
2813 2012-10-12 Anders Carlsson <andersca@apple.com>
2815 Move QDataStream functions into HistoryItemQt.cpp
2816 https://bugs.webkit.org/show_bug.cgi?id=99203
2818 Reviewed by Andreas Kling.
2820 It seems like the QDataStream stream operators are only used from HistoryItemQt.cpp
2821 inside WebCore, so move them there. If in the future they are required elsewhere, they should
2822 be moved into a separate header instead of polluting headers unnecessarily.
2825 * wtf/qt/StringQt.cpp:
2826 * wtf/text/WTFString.h:
2828 2012-10-11 Mark Toller <mark.toller@samsung.com>
2830 Removed incorrect pthread_mutex_trylock code in an ASSERT in TCMalloc_PageHeap::signalScavenger. This
2831 branch is used by the Webkit GTK code.
2833 https://bugs.webkit.org/show_bug.cgi?id=97539
2835 Reviewed by Geoffrey Garen.
2837 The code was never compiled in, and was functionally broken. There is no need for locking around the
2838 m_scavengeThreadActive flag, however, we should lock pageheap_lock before calling 'shouldScavenge()', as we
2839 only want to scavenge when really required, so it's better to wait for any current memory operation to
2840 complete before checking.
2842 * wtf/FastMalloc.cpp:
2843 (WTF::TCMalloc_PageHeap::signalScavenger):
2845 2012-10-10 Yong Li <yoli@rim.com>
2847 [BlackBerry] Define WTF_USE_EXTRA_MACROS in cmake rather than Platform.h
2848 https://bugs.webkit.org/show_bug.cgi?id=98819
2850 Reviewed by Rob Buis.
2852 And make it depend on SHARED_CORE
2857 2012-10-09 Filip Pizlo <fpizlo@apple.com>
2859 JSC should infer when indexed storage is contiguous, and optimize for it
2860 https://bugs.webkit.org/show_bug.cgi?id=97288
2862 Reviewed by Mark Hahnenberg.
2864 Moved out this helpful math utility to MathExtras, since we now use it in
2868 (timesThreePlusOneDividedByTwo):
2870 2012-10-08 Benjamin Poulain <benjamin@webkit.org>
2872 Generalize moving URLComponent's begin position
2873 https://bugs.webkit.org/show_bug.cgi?id=98626
2875 Reviewed by Adam Barth.
2877 The patch r130609 introduced moving URLComponents's position.
2878 It turns out this concept is really useful in the parser so
2879 this patch generalize the idea.
2881 * wtf/url/api/ParsedURL.cpp:
2882 (WTF::ParsedURL::removePort):
2883 * wtf/url/src/URLCanonEtc.cpp:
2884 * wtf/url/src/URLComponent.h:
2885 (WTF::URLComponent::moveBy):
2886 Rename URLComponent::move() to URLComponent::moveBy() for consistency
2887 with some of WebCore types.
2889 * wtf/url/src/URLParse.cpp:
2890 * wtf/url/src/URLParseFile.cpp:
2892 * wtf/url/src/URLSegments.cpp:
2893 (WTF::URLSegments::moveFromComponentBy):
2894 Change the semantic to everything from a certain component. This is
2895 useful to move everything, including the scheme.
2897 * wtf/url/src/URLSegments.h:
2900 2012-10-08 Andreas Kling <kling@webkit.org>
2902 Lower minimum table size of WTF::HashTable to reduce memory usage.
2903 <http://webkit.org/b/98406>
2904 <rdar://problem/12432140>
2906 Reviewed by Anders Carlsson.
2908 Lower the default minimumTableSize for WTF hash tables from 64 to 8 entries.
2909 This reduces WebProcess memory consumption by ~16MB on Membuster3 (a 6% progression!)
2911 No significant movement on PLT or JSC benchmarks on my machine. If there's a perf regression somewhere
2912 from this, we can tweak individual tables to have a larger minimumTableSize.
2916 2012-10-08 Andreas Kling <kling@webkit.org>
2918 Using float/double as WTF hash table key is unreliable.
2919 <http://webkit.org/b/98627>
2921 Reviewed by Geoffrey Garen.
2923 Change FloatHash::equal() to do a bitwise compare instead of a logical compare.
2924 This fixes a problem where the keys with different binary representation but the
2925 same logical value (e.g 0 and -0) could block each other from being found if they
2926 ended up in the same hash bucket.
2928 * wtf/HashFunctions.h:
2930 (WTF::FloatHash::hash):
2931 (WTF::FloatHash::equal):
2933 2012-10-08 Sheriff Bot <webkit.review.bot@gmail.com>
2935 Unreviewed, rolling out r130619.
2936 http://trac.webkit.org/changeset/130619
2937 https://bugs.webkit.org/show_bug.cgi?id=98634
2939 Causes many crashes on the EFL bots. (Requested by rakuco on
2942 * wtf/efl/MainThreadEfl.cpp:
2945 (WTF::monitorDispatchFunctions):
2946 (WTF::initializeMainThreadPlatform):
2947 (WTF::scheduleDispatchFunctionsOnMainThread):
2949 2012-10-08 Byungwoo Lee <bw80.lee@samsung.com>
2951 [EFL] Use ecore_main_loop_thread_safe_call_async() to wakeup main loop.
2952 https://bugs.webkit.org/show_bug.cgi?id=98505
2954 Reviewed by Kenneth Rohde Christiansen.
2956 Instead of ecore_pipe_write(),
2957 use ecore_main_loop_thread_safe_call_async() to wakeup ecore main loop.
2959 According to the EFL API document, this function is designed to dispatch
2960 a function on ecore main loop by avoiding dead lock or race condition.
2961 With this function, webkit doesn't need to maintain ecore pipe also.
2963 * wtf/efl/MainThreadEfl.cpp:
2964 (WTF::monitorDispatchFunctions):
2965 (WTF::initializeMainThreadPlatform):
2966 (WTF::scheduleDispatchFunctionsOnMainThread):
2968 2012-10-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
2970 Rename first/second to key/value in HashMap iterators
2971 https://bugs.webkit.org/show_bug.cgi?id=82784
2973 Reviewed by Eric Seidel.
2975 Currently HashMap iterators follow the same interface in std::map: given an
2976 iterator it, we use it->first to access the key and it->second to access the
2977 value. This patch changes these accesses to it->key and it->value, improving the
2978 readability at call sites.
2980 One potential downside of this change would be the confusion between std::map and
2981 HashMap interfaces. However, they are already different in other aspects and the
2982 usage of std::map is more an exception than a rule in WebKit code, so we consider
2983 the confusion will be less likely to happen.
2985 * wtf/HashCountedSet.h:
2988 (WTF::copyToVector):
2989 * wtf/HashIterators.h:
2990 (WTF::HashTableConstKeysIterator::get):
2991 (WTF::HashTableConstValuesIterator::get):
2992 (WTF::HashTableKeysIterator::get):
2993 (WTF::HashTableValuesIterator::get):
2995 (WTF::KeyValuePairKeyExtractor::extract):
2996 (WTF::HashMapValueTraits::isEmptyValue):
2997 (WTF::HashMapTranslator::translate):
2998 (WTF::HashMapTranslatorAdapter::translate):
3003 (WTF::deleteAllValues):
3004 (WTF::deleteAllKeys):
3005 Removed deleteAllPairFirsts() and deleteAllPairSeconds() since they are now unused.
3008 (WTF::hashTableSwap):
3009 (WTF::::checkTableConsistencyExceptSize):
3012 (WTF::KeyValuePair::KeyValuePair):
3014 (WTF::KeyValuePairHashTraits::constructDeletedValue):
3015 (WTF::KeyValuePairHashTraits::isDeletedValue):
3016 * wtf/MetaAllocator.cpp:
3017 (WTF::MetaAllocator::addFreeSpace):
3018 (WTF::MetaAllocator::incrementPageOccupancy):
3019 (WTF::MetaAllocator::decrementPageOccupancy):
3020 * wtf/RefCountedLeakCounter.cpp:
3021 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter):
3022 * wtf/RefPtrHashMap.h:
3028 (WTF::Spectrum::add):
3029 (WTF::Spectrum::get):
3030 (WTF::Spectrum::buildList):
3031 * wtf/ThreadingPthreads.cpp:
3032 (WTF::identifierByPthreadHandle):
3034 2012-10-07 Benjamin Poulain <benjamin@webkit.org>
3036 WTFURL: implement URL port removal for HTMLAnchorElement
3037 https://bugs.webkit.org/show_bug.cgi?id=98604
3039 Reviewed by Adam Barth.
3041 Add hasStandardScheme() (similar to isStandard from Google URL),
3042 hasPort() and removePort() to implement the port removal of KURL.
3044 * wtf/url/api/ParsedURL.cpp:
3045 (WTF::ParsedURL::hasStandardScheme):
3046 (WTF::ParsedURL::hasPort):
3047 (WTF::ParsedURL::removePort):
3048 * wtf/url/api/ParsedURL.h:
3050 * wtf/url/src/URLComponent.h:
3051 (WTF::URLComponent::move):
3052 * wtf/url/src/URLSegments.cpp:
3053 (WTF::URLSegments::moveComponentsAfter):
3054 * wtf/url/src/URLSegments.h:
3056 * wtf/url/src/URLUtil.cpp:
3058 (WTF::URLUtilities::isStandard):
3059 * wtf/url/src/URLUtil.h:
3061 Remove LowerCaseEqualsASCII() from the interface, make it an internal template.
3063 (WTF::URLUtilities::isStandard):
3064 Since in WebKit, LChar is a superset of char, expose LChar and cast char* to LChar*.
3066 2012-10-06 Ilya Tikhonovsky <loislo@chromium.org>
3068 Web Inspector: NMI fix String instrumentation the way it was discussed in WK97964
3069 https://bugs.webkit.org/show_bug.cgi?id=98500
3071 Reviewed by Benjamin Poulain.
3073 Current instrumentation incorrectly covers the case when StringImpl object has been created via StringImpl::createWithTerminatingNullCharacter().
3074 Looks like the only way to detect the strings that has been created from literals is to compare the addresses of buffer and stringImpl + 1.
3076 * wtf/MemoryInstrumentationString.h:
3077 (WTF::reportMemoryUsage):
3078 * wtf/text/StringImpl.h:
3079 (WTF::StringImpl::hasInternalBuffer):
3081 2012-10-06 Benjamin Poulain <benjamin@webkit.org>
3083 Fix build of WTFURL after r130187
3084 https://bugs.webkit.org/show_bug.cgi?id=98588
3086 Reviewed by Kentaro Hara.
3088 * wtf/MemoryInstrumentationParsedURL.h:
3089 (WTF::reportMemoryUsage):
3090 * wtf/url/api/ParsedURL.h:
3091 (WTF::ParsedURL::spec):
3093 2012-10-05 Simon Pena <spena@igalia.com>
3095 [GTK] Add support for GBytes in GRefPtr
3096 https://bugs.webkit.org/show_bug.cgi?id=98489
3098 Reviewed by Carlos Garcia Campos.
3100 Adding support for GBytes in GRefPtr makes it easier
3101 for them to be used when adding GResources support,
3102 and is more consistent with the rest of the port.
3104 This calls g_bytes_ref and g_bytes_unref in the implementation
3105 of the refPtr and derefPtr template functions, in case the GLib
3106 version is met. Otherwise, it does nothing.
3108 * wtf/gobject/GRefPtr.cpp: Implement templates for ref and deref.
3112 * wtf/gobject/GRefPtr.h:
3114 * wtf/gobject/GTypedefs.h: Define the GBytes datatype.
3116 2012-10-05 Sheriff Bot <webkit.review.bot@gmail.com>
3118 Unreviewed, rolling out r130478.
3119 http://trac.webkit.org/changeset/130478
3120 https://bugs.webkit.org/show_bug.cgi?id=98494
3122 It broke the Qt build (Requested by Ossy on #webkit).
3124 * wtf/gobject/GRefPtr.cpp:
3125 * wtf/gobject/GRefPtr.h:
3127 * wtf/gobject/GTypedefs.h:
3129 2012-10-05 Simon Pena <spena@igalia.com>
3131 [GTK] Add support for GBytes in GRefPtr
3132 https://bugs.webkit.org/show_bug.cgi?id=98489
3134 Reviewed by Carlos Garcia Campos.
3136 Adding support for GBytes in GRefPtr makes it easier
3137 for them to be used when adding GResources support,
3138 and is more consistent with the rest of the port.
3140 This calls g_bytes_ref and g_bytes_unref in the implementation
3141 of the refPtr and derefPtr template functions.
3143 * wtf/gobject/GRefPtr.cpp: Implement templates for ref and deref.
3147 * wtf/gobject/GRefPtr.h:
3149 * wtf/gobject/GTypedefs.h: Define the GBytes datatype.
3151 2012-10-04 Dirk Pranke <dpranke@chromium.org>
3153 Unreviewed, rolling out r130419.
3154 http://trac.webkit.org/changeset/130419
3155 https://bugs.webkit.org/show_bug.cgi?id=98406
3157 broke editing/pasteboard/data-transfer-items.html on chromium
3161 2012-10-04 Andreas Kling <kling@webkit.org>
3163 Lower minimum table size of WTF::HashTable to reduce memory usage.
3164 <http://webkit.org/b/98406>
3165 <rdar://problem/12432140>
3167 Reviewed by Anders Carlsson.
3169 Lower the default minimumTableSize for WTF hash tables from 64 to 8 entries.
3170 This reduces WebProcess memory consumption by ~16MB on Membuster3 (a 6% progression!)
3172 No significant movement on PLT or JSC benchmarks on my machine. If there's a perf regression somewhere
3173 from this, we can tweak individual tables to have a larger minimumTableSize.
3177 2012-10-04 Michael Saboff <msaboff@apple.com>
3179 String::remove will convert an 8 bit string to a 16 bit string
3180 https://bugs.webkit.org/show_bug.cgi?id=98299
3182 Reviewed by Benjamin Poulain.
3184 Added an 8 bit path to remove(). Added a private templated helper removeInternal.
3186 * wtf/text/WTFString.cpp:
3187 (WTF::String::removeInternal):
3188 (WTF::String::remove):
3189 * wtf/text/WTFString.h:
3192 2012-10-03 Kangil Han <kangil.han@samsung.com>
3194 [Refactoring] Tidy NDEBUG optioning in RefCountedBase.
3195 https://bugs.webkit.org/show_bug.cgi?id=98252
3197 Reviewed by Benjamin Poulain.
3199 Fixed incomplete implementation for NDEBUG option.
3200 Additionally, adopted CHECK_REF_COUNTED_LIFECYCLE definition to suppress abusing NDEBUG option.
3204 (WTF::RefCountedBase::ref):
3205 (WTF::RefCountedBase::hasOneRef):
3206 (WTF::RefCountedBase::refCount):
3207 (WTF::RefCountedBase::turnOffVerifier):
3208 (WTF::RefCountedBase::relaxAdoptionRequirement):
3209 (WTF::RefCountedBase::RefCountedBase):
3210 (WTF::RefCountedBase::~RefCountedBase):
3211 (WTF::RefCountedBase::derefBase):
3214 (WTF::RefCountedBase::setMutexForVerifier):
3215 (WTF::RefCountedBase::setDispatchQueueForVerifier):
3217 2012-10-03 Yury Semikhatsky <yurys@chromium.org>
3219 Remove MemoryInstrumentation::addCollectionElements
3220 https://bugs.webkit.org/show_bug.cgi?id=98245
3222 Reviewed by Vsevolod Vlasov.
3224 Removed MemoryInstrumentation::addCollectionElements and switched all call sites
3225 to reportSequenceMemoryUsage.
3227 Drive-by fix: removed some unused methods on MemoryInstrumentation.
3229 * wtf/MemoryInstrumentation.h:
3230 * wtf/MemoryInstrumentationHashSet.h:
3231 (WTF::reportMemoryUsage):
3232 * wtf/MemoryInstrumentationSequence.h:
3233 (WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
3234 * wtf/MemoryInstrumentationVector.h:
3235 (WTF::reportMemoryUsage):
3237 2012-10-02 Yury Semikhatsky <yurys@chromium.org>
3239 Provide memory instrumentation for HashCountedSet
3240 https://bugs.webkit.org/show_bug.cgi?id=98138
3242 Reviewed by Pavel Feldman.
3244 Added memory instrumentation for HashCountedSet.
3246 Extracted common routines for collecting memory info for an iterable sequence.
3248 * GNUmakefile.list.am:
3251 * WTF.vcproj/WTF.vcproj:
3252 * WTF.xcodeproj/project.pbxproj:
3253 * wtf/MemoryInstrumentation.h:
3255 * wtf/MemoryInstrumentationHashCountedSet.h: Copied from Source/WTF/wtf/MemoryInstrumentationHashSet.h.
3257 (WTF::reportMemoryUsage):
3258 * wtf/MemoryInstrumentationHashMap.h:
3259 (WTF::reportMemoryUsage):
3260 * wtf/MemoryInstrumentationHashSet.h:
3261 * wtf/MemoryInstrumentationSequence.h: Copied from Source/WTF/wtf/MemoryInstrumentationHashMap.h.
3263 (WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
3264 (WTF::reportSequenceMemoryUsage):
3266 2012-10-02 Joshua Bell <jsbell@chromium.org>
3268 Add htons/htonl definitions and implementations
3269 https://bugs.webkit.org/show_bug.cgi?id=98054
3271 Reviewed by Darin Adler.
3273 For parsing or serializing binary data, byte order matters. The canonical htons/htonl/
3274 ntohs/ntohl functions are not present everywhere, so implementations are proliferating in
3275 parsers. Expose a new WTF header (wtf/ByteOrder.h) that includes the standard
3276 implementations on UNIX-like OSs and provides basic inlined implementations on Windows.
3278 * GNUmakefile.list.am:
3281 * WTF.vcproj/WTF.vcproj:
3282 * WTF.xcodeproj/project.pbxproj:
3283 * wtf/ByteOrder.h: Added.
3284 (WTF::wswap32): Inline functions so arguments are only evaluated once.
3287 (ntohs): Inline functions on OS(WINDOWS) to match macros on OS(UNIX)
3291 * wtf/CMakeLists.txt:
3293 2012-10-02 Michael Saboff <msaboff@apple.com>
3295 HTMLConstructionSite::insertTextNode isn't optimized for 8 bit strings
3296 https://bugs.webkit.org/show_bug.cgi?id=97740
3298 Reviewed by Darin Adler.
3300 Added an append method that takes an LChar source. Made both the UChar and LChar versions optimally handle
3301 the appendee and appendend string bitness.
3303 * wtf/text/WTFString.cpp:
3304 (WTF::String::append):
3305 * wtf/text/WTFString.h:
3308 2012-10-02 Ilya Tikhonovsky <loislo@chromium.org>
3310 Web Inspector: NMI: switch to non intrusive instrumentation of ParsedURL.
3311 https://bugs.webkit.org/show_bug.cgi?id=98150
3313 Reviewed by Yury Semikhatsky.
3315 Memory instrumentation for ParsedURL was extracted into separate header MemoryInstrumentationParsedURL.h
3317 Drive by fix: unnecessary include was removed from String*.cpp files.
3319 * GNUmakefile.list.am:
3322 * WTF.xcodeproj/project.pbxproj:
3323 * wtf/MemoryInstrumentation.h:
3325 * wtf/MemoryInstrumentationParsedURL.h: Added.
3327 (WTF::reportMemoryUsage):
3328 * wtf/text/AtomicString.cpp:
3329 * wtf/text/StringImpl.cpp:
3330 * wtf/text/WTFString.cpp:
3331 * wtf/url/api/ParsedURL.cpp:
3332 * wtf/url/api/ParsedURL.h:
3333 * wtf/url/api/URLString.cpp:
3334 * wtf/url/api/URLString.h:
3336 2012-09-29 Ilya Tikhonovsky <loislo@chromium.org>
3338 Web Inspector: NMI make String* instrumentation non intrusive
3339 https://bugs.webkit.org/show_bug.cgi?id=97964
3341 Reviewed by Yury Semikhatsky.
3343 MemoryInstrumentationString.h was added.
3344 Intrusive instrumentation was removed.
3346 * GNUmakefile.list.am:
3349 * WTF.vcproj/WTF.vcproj:
3350 * WTF.xcodeproj/project.pbxproj:
3351 * wtf/MemoryInstrumentation.h:
3353 * wtf/MemoryInstrumentationString.h: Added.
3355 (WTF::reportMemoryUsage):
3356 * wtf/text/AtomicString.cpp:
3358 * wtf/text/AtomicString.h:
3360 * wtf/text/CString.h:
3361 (WTF::CStringBuffer::length):
3362 * wtf/text/StringImpl.cpp:
3363 * wtf/text/StringImpl.h:
3364 (WTF::StringImpl::usesInternalBuffer):
3365 (WTF::StringImpl::baseString):
3368 2012-10-02 Sheriff Bot <webkit.review.bot@gmail.com>
3370 Unreviewed, rolling out r130129.
3371 http://trac.webkit.org/changeset/130129
3372 https://bugs.webkit.org/show_bug.cgi?id=98125
3374 broke 4 webkit_unit_tests
3375 (MemoryInstrumentationTest.hashMapWith*) (Requested by caseq
3378 * GNUmakefile.list.am:
3381 * WTF.vcproj/WTF.vcproj:
3382 * WTF.xcodeproj/project.pbxproj:
3383 * wtf/MemoryInstrumentation.h:
3385 * wtf/MemoryInstrumentationString.h: Removed.
3386 * wtf/text/AtomicString.cpp:
3387 (WTF::AtomicString::reportMemoryUsage):
3389 * wtf/text/AtomicString.h:
3391 * wtf/text/CString.h:
3392 (WTF::CStringBuffer::length):
3394 (WTF::CStringBuffer::reportMemoryUsage):
3396 (WTF::CString::reportMemoryUsage):
3397 * wtf/text/StringImpl.cpp:
3398 (WTF::StringImpl::reportMemoryUsage):
3400 * wtf/text/StringImpl.h:
3402 * wtf/text/WTFString.cpp:
3403 (WTF::String::reportMemoryUsage):
3405 * wtf/text/WTFString.h:
3408 2012-09-29 Ilya Tikhonovsky <loislo@chromium.org>
3410 Web Inspector: NMI make String* instrumentation non intrusive
3411 https://bugs.webkit.org/show_bug.cgi?id=97964
3413 Reviewed by Yury Semikhatsky.
3415 MemoryInstrumentationString.h was added.
3416 Intrusive instrumentation was removed.
3418 * GNUmakefile.list.am:
3421 * WTF.vcproj/WTF.vcproj:
3422 * WTF.xcodeproj/project.pbxproj:
3423 * wtf/MemoryInstrumentation.h:
3425 * wtf/MemoryInstrumentationString.h: Added.
3427 (WTF::reportMemoryUsage):
3428 * wtf/text/AtomicString.cpp:
3430 * wtf/text/AtomicString.h:
3432 * wtf/text/CString.h:
3433 (WTF::CStringBuffer::length):
3434 * wtf/text/StringImpl.cpp:
3435 * wtf/text/StringImpl.h:
3436 (WTF::StringImpl::usesInternalBuffer):
3437 (WTF::StringImpl::baseString):
3440 2012-10-01 Daniel Drake <dsd@laptop.org>
3442 Another SIGILL in JavaScriptCore on a Geode processor
3443 https://bugs.webkit.org/show_bug.cgi?id=96286
3445 Reviewed by Filip Pizlo.
3447 Disable LLint for the GTK build where the build target does not
3448 support SSE2 instructions. Restores support for non-SSE2 processors
3449 such as the AMD Geode.
3453 2012-10-01 Yury Semikhatsky <yurys@chromium.org>
3455 Web Inspector: provide memory instrumentation for HashMap
3456 https://bugs.webkit.org/show_bug.cgi?id=98005
3458 Reviewed by Pavel Feldman.
3460 Extracted HashMap memory instrumentation into its own file. The map's content
3461 elements will be automatically traversed if their types are supported
3462 by the memory instrumentation. No need to call special method for hash map
3465 * GNUmakefile.list.am:
3468 * WTF.vcproj/WTF.vcproj:
3469 * wtf/MemoryInstrumentation.h:
3470 (MemoryInstrumentation):
3472 * wtf/MemoryInstrumentationHashMap.h: Added.
3474 (WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
3475 (WTF::reportMemoryUsage):
3477 2012-10-01 Alberto Garcia <agarcia@igalia.com>
3479 Check that __cplusplus is defined before comparing its value
3480 https://bugs.webkit.org/show_bug.cgi?id=98015
3482 Reviewed by Xan Lopez.
3484 If __cplusplus is not defined is interpreted as having the value
3485 0, but it produces a compilation warning with -Wundef.
3487 This is the case with some API tests that are written in C
3488 (JSNode.c, JSNodeList.c, minidom.c).
3492 2012-10-01 Carlos Garcia Campos <cgarcia@igalia.com>
3494 Unreviewed. Fix make distcheck.
3496 * GNUmakefile.list.am: Add missing header files to compilation.
3498 2012-09-30 Mark Hahnenberg <mhahnenberg@apple.com>
3500 Clean up HasTrivialConstructor/Destructor
3501 https://bugs.webkit.org/show_bug.cgi?id=97754
3503 Reviewed by Sam Weinig.
3505 Mixed up the HasTrivialDestructor/Constructor case for VS2010 and later in the previous patch.
3509 2012-09-29 Sheriff Bot <webkit.review.bot@gmail.com>
3511 Unreviewed, rolling out r129982.
3512 http://trac.webkit.org/changeset/129982
3513 https://bugs.webkit.org/show_bug.cgi?id=97971
3515 hit assert in fast/overflow/overflow-height-float-not-removed-
3516 crash3.html (Requested by eae on #webkit).
3520 2012-09-29 Emil A Eklund <eae@chromium.org>
3522 Enable SATURATED_LAYOUT_ARITHMETIC for chromium
3523 https://bugs.webkit.org/show_bug.cgi?id=95053
3525 Reviewed by Abhishek Arya.
3527 Enable the SATURATED_LAYOUT_ARITHMETIC flag for the chromium port.
3528 This changes the behavior of FractionalLayoutUnit to clamp to the
3529 max or min value instead of overflowing.
3531 This may very well impact performance so the current plan is to enable
3532 it for a couple of hours to a day to collect performance data and then
3533 disable it again until we've had a chance to review the perf data.
3537 2012-09-28 Anders Carlsson <andersca@apple.com>
3540 https://bugs.webkit.org/show_bug.cgi?id=97954
3542 Reviewed by Sam Weinig.
3544 The Java bridge is not used by any port; Mac now has a NPAPI Java plug-in.
3548 2012-09-28 Kai Koehne <kai.koehne@digia.com>
3550 Disable YARR_JIT for Windows 64 bit
3551 https://bugs.webkit.org/show_bug.cgi?id=97772
3553 Reviewed by Simon Hausmann.
3555 Using YARR_JIT requires ASSEMBLER, which in turn enables the
3556 executable fixed allocator, which is mmap based (not available on
3561 2012-09-28 Yury Semikhatsky <yurys@chromium.org>
3563 Web Inspector: make HashSet memory instrumentation non-intrusive
3564 https://bugs.webkit.org/show_bug.cgi?id=97879
3566 Reviewed by Vsevolod Vlasov.
3568 Removed reportMemoryUsage declarations as a friend of HashSet and HashTable. Also
3569 removed MemoryInstrumentationHashTable which is not needed if we don't have
3570 access to HashSet's guts.
3572 * GNUmakefile.list.am:
3575 * WTF.vcproj/WTF.vcproj:
3576 * WTF.xcodeproj/project.pbxproj:
3582 * wtf/MemoryInstrumentation.h:
3583 (WTF::MemoryClassInfo::addPrivateBuffer):
3584 * wtf/MemoryInstrumentationHashSet.h:
3585 (WTF::reportMemoryUsage):
3586 * wtf/MemoryInstrumentationHashTable.h: Removed.
3588 2012-09-27 Anders Carlsson <andersca@apple.com>
3590 Remove the clang pragmas to disable warnings in Noncopyable.h
3591 https://bugs.webkit.org/show_bug.cgi?id=97826
3593 Reviewed by Beth Dakin.
3595 Warnings about C++11 extensions are already disabled project-wide now so there's no need
3596 to keep these pragmas.
3598 * wtf/Noncopyable.h:
3600 2012-09-26 Mark Hahnenberg <mhahnenberg@apple.com>
3602 Clean up HasTrivialConstructor/Destructor
3603 https://bugs.webkit.org/show_bug.cgi?id=97754
3605 Reviewed by Darin Adler.
3607 Cleaned up HasTrivialConstructor and HasTrivialDestructor by defining them in terms of
3608 other type traits we have. Also moved some ifdefs and comments to make things more clear.
3612 2012-09-27 Ilya Tikhonovsky <loislo@chromium.org>
3614 Web Inspector: NMI: move visited and countObjectSize methods implementation into separate class.
3615 https://bugs.webkit.org/show_bug.cgi?id=97461
3617 Reviewed by Yury Semikhatsky.
3619 These methods and the data collected by them need to be used in the instrumentation code for other components.
3620 As example when we are visiting bitmaps we need to visit platform specific objects.
3621 These objects will be instrumented with help of component's own instrumentation code
3622 but we have to keep the single set of visited objects and the map of counters.