1 2013-02-10 Laszlo Gombos <l.gombos@samsung.com>
3 Consolidate the way WTF_USE_PTHREADS is enabled
4 https://bugs.webkit.org/show_bug.cgi?id=108191
6 Reviewed by Benjamin Poulain.
8 Define WTF_USE_PTHREADS to 1 on all OS(UNIX) environments.
10 * WTF.gyp/WTF.gyp: Remove duplicated definition of WTF_USE_PTHREADS.
13 2013-02-10 Laszlo Gombos <l.gombos@samsung.com>
15 Refactor the way HAVE_XXX macros are set
16 https://bugs.webkit.org/show_bug.cgi?id=108132
18 Reviewed by Benjamin Poulain.
20 OS(WINDOWS) and OS(UNIX) are so broadly defined that for each
21 builds exactly one of them is enabled. Use this assumption to
26 2013-02-10 Jae Hyun Park <jae.park08@gmail.com>
28 Rename ENABLE(GLIB_SUPPORT) to USE(GLIB)
29 https://bugs.webkit.org/show_bug.cgi?id=104266
31 Reviewed by Philippe Normand.
33 Using USE(GLIB) instead of ENABLE(GLIB_SUPPORT) is more consistent with
34 the existing macro naming conventions.
37 USE() - use a particular third-party library or optional OS service
38 ENABLE() - turn on a specific feature of WebKit
42 * wtf/gobject/GOwnPtr.cpp:
43 * wtf/gobject/GOwnPtr.h:
44 * wtf/gobject/GRefPtr.cpp:
45 * wtf/gobject/GRefPtr.h:
47 2013-02-08 Michael Saboff <msaboff@apple.com>
49 ARM_NEON Inline Assembly for copyLCharsFromUCharSource() inefficient for aligned destinations
50 https://bugs.webkit.org/show_bug.cgi?id=109335
52 Reviewed by Filip Pizlo.
54 Change a "do while" to a "while" so that we don't copy single characters to align the
55 destination when it is already aligned.
57 * wtf/text/ASCIIFastPath.h:
58 (WTF::copyLCharsFromUCharSource):
60 2013-02-08 Jer Noble <jer.noble@apple.com>
62 Bring WebKit up to speed with latest Encrypted Media spec.
63 https://bugs.webkit.org/show_bug.cgi?id=97037
65 Reviewed by Eric Carlson.
67 Define the ENABLE_ENCRYPTED_MEDIA_V2 setting.
71 2013-02-08 Adam Barth <abarth@webkit.org>
73 Use WeakPtrs to communicate between the HTMLDocumentParser and the BackgroundHTMLParser
74 https://bugs.webkit.org/show_bug.cgi?id=107190
76 Reviewed by Eric Seidel.
78 Add the ability to create an unbound weak reference. This facility lets
79 you start sending messages to a WeakPtr on another thread before the
80 object backing the WeakPtr has actually been created.
83 (WTF::WeakReference::createUnbound):
84 (WTF::WeakReference::bindTo):
86 (WTF::WeakReference::WeakReference):
87 (WTF::WeakPtr::WeakPtr):
89 (WTF::WeakPtrFactory::WeakPtrFactory):
91 (WTF::WeakPtrFactory::revokeAll):
93 2013-02-08 Martin Robinson <mrobinson@igalia.com>
95 [GTK] Add an experimental gyp build
96 https://bugs.webkit.org/show_bug.cgi?id=109003
98 Reviewed by Gustavo Noronha Silva.
100 * WTF.gyp/WTF.gyp: Filter out MetaAllocator.(cpp/h) from the Chromium
101 build. It's only necessary for GTK+.
102 * WTF.gypi: Add MetaAllocator to the build for WebKitGTK+.
104 2013-02-06 Ilya Tikhonovsky <loislo@chromium.org>
106 Web Inspector: Native Memory Instrumentation: reportBaseAddress needs to be called after the reportNode. So it may reuse the node index for the real address.
107 https://bugs.webkit.org/show_bug.cgi?id=109051
109 Reviewed by Yury Semikhatsky.
111 * wtf/MemoryInstrumentation.cpp:
112 (WTF::MemoryInstrumentation::WrapperBase::processPointer):
114 2013-02-07 David Kilzer <ddkilzer@apple.com>
116 Fix #endif comment from r142163 and r142183
119 (WTF): s/PLATFORM/USE/
121 2013-02-07 Benjamin Poulain <bpoulain@apple.com>
123 Fix an incorrect comment from r142163
128 I accidentally copied PLATFORM(IOS) instead of USE(WEB_THREAD) for the #ifdef closing.
130 2013-02-07 Benjamin Poulain <bpoulain@apple.com>
132 Upstream iOS isWebThread() and isUIThread()
133 https://bugs.webkit.org/show_bug.cgi?id=109130
135 Reviewed by Sam Weinig.
137 On iOS, it is sometimes necessary to differenciate the thread running WebCore,
138 and the thread running the UI. This patch upstream those functions.
140 * wtf/MainThread.cpp:
142 Disable the legacy initializer as it is incorrect when using the WebThread to run WebCore.
145 Return true when the current thread is the Web/UI thread.
147 * wtf/mac/MainThreadMac.mm:
151 * wtf/text/AtomicString.cpp:
152 (WTF::AtomicStringTable::create):
153 Use the newly added methods.
155 2013-02-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
157 [Qt] Fix build without 3D_GRAPHICS
158 https://bugs.webkit.org/show_bug.cgi?id=109194
160 Reviewed by Noam Rosenthal.
162 Now that Coordinated Graphics was moved to WebCore, we need to explicitly enable
163 it when we have 3D_GRAPHICS. This dependency was implicitly by the fact that
164 3D_GRAPHICS is a dependency of WebKit2 and Coordinated Graphics was only
165 available there. This should fix build for Qt SH4 Linux.
169 2013-02-06 Zan Dobersek <zdobersek@igalia.com>
171 [WTFURL] Fix erroneous header inclusions in WTFURL code
172 https://bugs.webkit.org/show_bug.cgi?id=109040
174 Reviewed by Benjamin Poulain.
176 Include WTFURL API headers from files in Source/WTF/wtf/url/src
177 by specifying their relative path to Source/WTF.
179 * GNUmakefile.am: The changes make it possible to compile the WTF library
180 without specifying both Source/WTF/wtf/url/api and Source/WTF/wtf/url/src
181 as inclusion directories in CPPFLAGS, so remove these two entries.
182 * wtf/url/src/RawURLBuffer.h:
183 * wtf/url/src/URLCanon.h: Include the URLParse.h header by specifying
184 only the base name as it's located in the same directory.
185 * wtf/url/src/URLCanonQuery.cpp:
186 * wtf/url/src/URLUtil.h:
188 2013-02-06 Tony Gentilcore <tonyg@chromium.org>
190 Call XSSAuditor's didBlockScript() for the threaded HTML parser
191 https://bugs.webkit.org/show_bug.cgi?id=108726
193 Reviewed by Adam Barth.
195 This patch adds isSafeToSendToAnotherThread() methods to CString, String, ParsedURL and URLString.
196 These methods check to ensure there are 0 or 1 references.
198 * wtf/text/CString.cpp:
199 (WTF::CString::isSafeToSendToAnotherThread): Added.
201 * wtf/text/CString.h:
203 * wtf/text/WTFString.cpp:
204 (WTF::String::isSafeToSendToAnotherThread): Added.
206 * wtf/text/WTFString.h:
208 * wtf/url/api/ParsedURL.h:
209 (WTF::ParsedURL::isSafeToSendToAnotherThread): Added.
210 * wtf/url/api/URLString.h:
211 (WTF::URLString::isSafeToSendToAnotherThread): Added.
213 2013-02-06 Ilya Tikhonovsky <loislo@chromium.org>
215 Web Inspector: Native Memory Instrumentation: assign class name to the heap graph node automatically
216 https://bugs.webkit.org/show_bug.cgi?id=107262
218 Reviewed by Yury Semikhatsky.
220 We need a way to calculate class name for a pointer automatically.
221 Otherwise we need to write className manually in all the instrumentation methods.
222 And for all reported but not instrumented classes.
224 C++ can do that for us with help of typeid but unfortunatelly it requires rtti.
225 There is another way to do that. C++ preprocessor provides a define which has a function name.
227 For g++ and clang it is __PRETTY_FUNCTION__.
228 For MSVC it is __FUNCTION__.
229 The content of the string is a function signature.
230 We can use it because it has the name of the template argument.
231 The format is sligthly different. That's why I made two different parsers.
232 One for MSVC the other for GCC, Clang etc.
233 The other problem is the resulting binary size.
234 I made very simple function that does the only thing, returns the smallest possible function signature.
235 Unfortunatelly MSVC doesn't generate template argument name for functions.
236 It does this only for classes.
238 * wtf/MemoryInstrumentation.cpp:
241 (WTF::MemoryClassInfo::callReportObjectInfo):
242 (WTF::MemoryClassInfo::init):
243 * wtf/MemoryInstrumentation.h:
247 (WTF::MemoryClassInfo::MemoryClassInfo):
249 (WTF::::reportObjectMemoryUsage):
251 2013-02-05 Mark Lam <mark.lam@apple.com>
253 Fix EnumClass so that it can be used with switch statements.
254 https://bugs.webkit.org/show_bug.cgi?id=109004.
256 Reviewed by Sam Weinig.
259 (WTF::EnumClass::operator==):
260 (WTF::EnumClass::operator!=):
261 (WTF::EnumClass::operator<):
262 (WTF::EnumClass::operator<=):
263 (WTF::EnumClass::operator>):
264 (WTF::EnumClass::operator>=):
266 (WTF::EnumClass::operator Value):
268 2013-02-05 Oliver Hunt <oliver@apple.com>
270 Disable TCMalloc hardening as it's breaking leaks.
272 Reviewed by Gavin Barraclough.
274 * wtf/FastMalloc.cpp:
276 2013-02-05 Mark Lam <mark.lam@apple.com>
278 Rename ENUM_CLASS_BEGIN() macro to ENUM_CLASS(), and make DatabaseType a strong enum.
279 https://bugs.webkit.org/show_bug.cgi?id=108988.
281 Reviewed by Alexey Proskuryakov.
285 2013-02-05 Roger Fong <roger_fong@apple.com>
287 Unreviewed build fix.
289 * wtf/FastMalloc.cpp:
291 2013-02-05 Benjamin Poulain <bpoulain@apple.com>
294 https://bugs.webkit.org/show_bug.cgi?id=108889
296 Reviewed by Ryosuke Niwa.
300 (WTF::StackBounds::isSafeToRecurse):
301 (WTF::StackBounds::size):
302 Adopt a more conventional style for a multiline branch.
304 (WTF::StackBounds::StackBounds):
305 (WTF::StackBounds::current):
306 (WTF::StackBounds::recursionLimit):
307 Make those method private.
309 Making the constructor private ensure initialize() is alwasy called on any StackBounds.
311 2013-02-05 Zan Dobersek <zdobersek@igalia.com>
313 [WTFURL] Comparison between signed and unsigned integer expressions in URLUtil.cpp
314 https://bugs.webkit.org/show_bug.cgi?id=108955
316 Reviewed by Benjamin Poulain.
318 * wtf/url/src/URLUtil.cpp:
319 (URLUtilities): Make the counter variable a signed integer to get rid of the warning.
321 2013-02-05 Benjamin Poulain <bpoulain@apple.com>
323 Rationalize the use of iOS/Mac #defines in Assertions.cpp
324 https://bugs.webkit.org/show_bug.cgi?id=108870
326 Reviewed by David Kilzer.
328 * wtf/Assertions.cpp: Instead of using PLATFORM(MAC) and assume it works for iOS and OS X,
329 use CF as the guard for CFString. Similarily, USE_APPLE_SYSTEM_LOG guards code using ASL.
331 2013-02-05 Benjamin Poulain <bpoulain@apple.com>
333 Make StringBuilder::toAtomicString() consistent with StringBuilder::toString() for strings of length zero
334 https://bugs.webkit.org/show_bug.cgi?id=108894
336 Reviewed by Andreas Kling.
338 * wtf/text/StringBuilder.h:
339 (WTF::StringBuilder::toAtomicString): The function was returning the nullAtom for strings of length zero.
340 This is inconsistent with StringBuilder::toString() which always return an empty string.
342 This patch unifies the behavior.
344 2013-02-04 Mark Hahnenberg <mhahnenberg@apple.com>
346 Structure::m_outOfLineCapacity is unnecessary
347 https://bugs.webkit.org/show_bug.cgi?id=108206
349 Reviewed by Darin Adler.
351 Simplifying the utility functions that we use since we don't need a
352 bunch of fancy templates for this one specific call site.
355 (WTF::roundUpToPowerOfTwo):
357 2013-02-05 Sheriff Bot <webkit.review.bot@gmail.com>
359 Unreviewed, rolling out r141905.
360 http://trac.webkit.org/changeset/141905
361 https://bugs.webkit.org/show_bug.cgi?id=108963
363 "Broke mac build" (Requested by tonyg-cr on #webkit).
365 * wtf/text/CString.cpp:
366 * wtf/text/CString.h:
367 * wtf/text/WTFString.cpp:
368 * wtf/text/WTFString.h:
370 * wtf/url/api/ParsedURL.h:
372 * wtf/url/api/URLString.h:
374 2013-02-05 Tony Gentilcore <tonyg@chromium.org>
376 Call XSSAuditor's didBlockScript() for the threaded HTML parser
377 https://bugs.webkit.org/show_bug.cgi?id=108726
379 Reviewed by Adam Barth.
381 This patch adds isSafeToSendToAnotherThread() methods to CString, String, ParsedURL and URLString.
382 These methods check to ensure there are 0 or 1 references.
384 * wtf/text/CString.cpp:
385 (WTF::CString::isSafeToSendToAnotherThread): Added.
387 * wtf/text/CString.h:
389 * wtf/text/WTFString.cpp:
390 (WTF::String::isSafeToSendToAnotherThread): Added.
392 * wtf/text/WTFString.h:
394 * wtf/url/api/ParsedURL.h:
395 (WTF::ParsedURL::isSafeToSendToAnotherThread): Added.
396 * wtf/url/api/URLString.h:
397 (WTF::URLString::isSafeToSendToAnotherThread): Added.
399 2013-02-04 Benjamin Poulain <bpoulain@apple.com>
401 Build fix for AtomicString on iOS
403 Unreviewed. The commit r141812 rely on isUIThread(), there is no such things
404 in the tree right now. Use pthread_main_np() until more thread handling is upstreamed.
406 * wtf/text/AtomicString.cpp:
407 (WTF::AtomicStringTable::create):
409 2013-02-04 Abhishek Arya <inferno@chromium.org>
411 Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access
412 https://bugs.webkit.org/show_bug.cgi?id=108668
414 Reviewed by Eric Seidel.
417 (WTF::AVLTreeDefaultBSet::operator[]):
419 (WTF::BitArray::set):
420 (WTF::BitArray::get):
421 * wtf/FastBitVector.h:
422 (WTF::FastBitVector::set):
423 (WTF::FastBitVector::clear):
424 (WTF::FastBitVector::get):
426 (WTF::FixedArray::operator[]):
427 * wtf/RefCountedArray.h:
428 (WTF::RefCountedArray::at):
429 * wtf/TypedArrayBase.h:
430 (WTF::TypedArrayBase::item):
431 * wtf/text/StringBuffer.h:
432 (WTF::StringBuffer::operator[]):
433 * wtf/text/StringBuilder.h:
434 (WTF::StringBuilder::operator[]):
435 * wtf/text/StringImpl.h:
436 (WTF::StringImpl::operator[]):
438 2013-02-04 Benjamin Poulain <benjamin@webkit.org>
440 Upstream iOS's AtomicString
441 https://bugs.webkit.org/show_bug.cgi?id=108139
443 Reviewed by David Kilzer.
445 On iOS, WebCore can be executed from two different threads. To maintain consistency,
446 a few changes had been made:
447 -The main UI thread and the WebThread share the same AtomicStringTable.
448 -A spin lock is needed before any access to prevent any concurrent modification of the string table.
449 The spin lock also prevent race on the static initialization of the shared table.
452 Introduce a new USE(WEB_THREAD) to scope changes related to iOS Web Thread.
453 * wtf/text/AtomicString.cpp:
454 (AtomicStringTableLocker):
455 (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
456 (WTF::AtomicStringTableLocker::~AtomicStringTableLocker):
457 (WTF::AtomicStringTable::create):
458 wtfThreadData() is not necessarily inlined on ARM. When it is not inlined, the old code
459 causes two call to the function. Instead, we can keep the value in register and pass it
460 to AtomicStringTable::create().
462 (WTF::addToStringTable):
463 (WTF::AtomicString::addSlowCase):
464 (WTF::AtomicString::find):
465 (WTF::AtomicString::remove):
467 2013-02-04 Martin Robinson <mrobinson@igalia.com>
469 Fix GTK+ 'make dist' in preparation for the 1.11.5 release.
471 * GNUmakefile.list.am:
473 2013-02-04 David Kilzer <ddkilzer@apple.com>
475 Sort WTF Xcode project file
477 * WTF.xcodeproj/project.pbxproj:
479 2013-02-02 Andreas Kling <akling@apple.com>
481 Vector should consult allocator about ideal size when choosing capacity.
482 <http://webkit.org/b/108410>
483 <rdar://problem/13124002>
485 Reviewed by Benjamin Poulain.
487 Added WTF::fastMallocGoodSize(), a workalike/wrapper for OS X's malloc_good_size().
488 It returns the actual size of the block that will get allocated for a given byte size.
490 Vector's internal buffer now checks with the allocator if the resulting allocation
491 could actually house more objects and updates its capacity to make use of the space.
494 (WTF::::expandCapacity):
495 * wtf/FastMalloc.cpp:
496 (WTF::fastMallocGoodSize):
499 (WTF::VectorBufferBase::allocateBuffer):
500 (WTF::VectorBufferBase::tryAllocateBuffer):
501 (WTF::VectorBufferBase::reallocateBuffer):
503 2013-02-02 Mark Rowe <mrowe@apple.com>
505 <http://webkit.org/b/108745> WTF shouldn't use a script build phase to detect the presence of headers when the compiler can do it for us
507 Reviewed by Sam Weinig.
509 * WTF.xcodeproj/project.pbxproj: Remove the script phase that used to generate a header file
510 containing information about whether certain header files exist on the system.
511 * wtf/FastMalloc.cpp: Use Clang's __has_include to detect whether the header exists before including it.
513 2013-02-01 Roger Fong <roger_fong@apple.com>
515 Unreviewed. WTF VS2010 project cleanup.
517 * WTF.vcxproj/WTF.vcxproj:
518 * WTF.vcxproj/WTF.vcxproj.filters:
519 * WTF.vcxproj/WTFPreLink.cmd: Removed.
521 2013-02-01 Zan Dobersek <zdobersek@igalia.com>
523 [GTK] Add WTFURL source files to the build
524 https://bugs.webkit.org/show_bug.cgi?id=108215
526 Reviewed by Benjamin Poulain.
528 The WTFURL implementation sources are all still guarded by the USE(WTFURL) guard,
529 meaning that the GTK port still uses the default KURL backend. To use the WTFURL
530 backend instead, one would have to define WTF_USE_WTFURL in Platform.h.
532 * GNUmakefile.am: List the directories from which source headers will be included.
533 Plenty of WTFURL code currently just includes the required header by name rather
534 than specifying the header path as relative to Source/WTF. In the future all the inclusions
535 should probaby be changed to include the header through the path relative to Source/WTF.
536 * GNUmakefile.list.am: Add build targets for the WTFURL source files.
537 * wtf/url/api/ParsedURL.cpp: Specify the complete path to the required headers and
538 reorder the inclusions.
539 * wtf/url/src/URLCanon.h: Ditto.
541 2013-01-18 Ilya Tikhonovsky <loislo@chromium.org>
543 Web Inspector: Native Memory Instrumentation: provide edge names and class names for WTF containers and strings
544 https://bugs.webkit.org/show_bug.cgi?id=107303
546 Reviewed by Yury Semikhatsky.
548 I'd like to use ValueType[] as className for the container data members
549 because class names of template parameters already present in the container class names.
551 * wtf/MemoryInstrumentationArrayBufferView.h:
552 (WTF::reportMemoryUsage):
553 * wtf/MemoryInstrumentationHashCountedSet.h:
554 (WTF::reportMemoryUsage):
555 * wtf/MemoryInstrumentationHashMap.h:
556 (WTF::reportMemoryUsage):
557 * wtf/MemoryInstrumentationHashSet.h:
558 (WTF::reportMemoryUsage):
559 * wtf/MemoryInstrumentationListHashSet.h:
560 (WTF::reportMemoryUsage):
561 * wtf/MemoryInstrumentationSequence.h:
562 * wtf/MemoryInstrumentationString.h:
563 (WTF::reportMemoryUsage):
564 * wtf/MemoryInstrumentationVector.h:
565 (WTF::reportMemoryUsage):
567 2013-02-01 Geoffrey Garen <ggaren@apple.com>
569 Added TriState to WTF and started using it in one place
570 https://bugs.webkit.org/show_bug.cgi?id=108628
572 Reviewed by Beth Dakin.
574 Useful for expressing "maybe" conditions in a boolean context.
576 * WTF.xcodeproj/project.pbxproj:
577 * wtf/TriState.h: Added.
580 2013-02-01 Patrick Gansterer <paroga@webkit.org>
582 Build fix for WinCE after r137709
583 https://bugs.webkit.org/show_bug.cgi?id=105767
585 Do not pass functions as const references to
586 templated arguments to make the compiler happy.
588 * wtf/StdLibExtras.h:
590 (WTF::tryBinarySearch):
591 (WTF::approximateBinarySearch):
593 2013-01-31 Ilya Tikhonovsky <loislo@chromium.org>
595 Web Inspector: Native Memory Instrumentation: replace nodeName argument with className
596 https://bugs.webkit.org/show_bug.cgi?id=107278
598 Reviewed by Yury Semikhatsky.
600 I replaced nodeName with className because we newer report node name for private and raw buffers
601 but need to report their class names.
603 * wtf/MemoryInstrumentation.cpp:
604 (WTF::MemoryInstrumentation::reportLinkToBuffer):
605 (WTF::MemoryClassInfo::addRawBuffer):
606 (WTF::MemoryClassInfo::addPrivateBuffer):
607 * wtf/MemoryInstrumentation.h:
608 (WTF::MemoryInstrumentation::addRawBuffer):
611 2013-01-31 Jessie Berlin <jberlin@apple.com>
613 Rolling out r141407 because it is causing crashes under
614 WTF::TCMalloc_Central_FreeList::FetchFromSpans() in Release builds.
617 (WTF::::expandCapacity):
618 * wtf/FastMalloc.cpp:
622 (WTF::VectorBufferBase::allocateBuffer):
623 (WTF::VectorBufferBase::tryAllocateBuffer):
624 (WTF::VectorBufferBase::reallocateBuffer):
626 2013-01-31 Mark Lam <mark.lam@apple.com>
628 Abstraction for hiding enum class.
629 https://bugs.webkit.org/show_bug.cgi?id=108533
631 Reviewed by Anders Carlsson.
634 * wtf/EnumClass.h: Copied from Source/WTF/wtf/TypeSafeEnum.h.
635 (WTF::EnumClass::EnumClass):
636 (WTF::EnumClass::operator==):
637 (WTF::EnumClass::operator!=):
638 (WTF::EnumClass::operator<):
639 (WTF::EnumClass::operator<=):
640 (WTF::EnumClass::operator>):
641 (WTF::EnumClass::operator>=):
642 * wtf/TypeSafeEnum.h: Removed.
644 2013-01-31 Andreas Kling <akling@apple.com>
646 Vector should consult allocator about ideal size when choosing capacity.
647 <http://webkit.org/b/108410>
648 <rdar://problem/13124002>
650 Reviewed by Benjamin Poulain.
652 Added WTF::fastMallocGoodSize(), a workalike/wrapper for OS X's malloc_good_size().
653 It returns the actual size of the block that will get allocated for a given byte size.
655 Vector's internal buffer now checks with the allocator if the resulting allocation
656 could actually house more objects and updates its capacity to make use of the space.
659 (WTF::::expandCapacity):
660 * wtf/FastMalloc.cpp:
661 (WTF::fastMallocGoodSize):
664 (WTF::VectorBufferBase::allocateBuffer):
665 (WTF::VectorBufferBase::tryAllocateBuffer):
666 (WTF::VectorBufferBase::reallocateBuffer):
668 2013-01-30 Christophe Dumez <christophe.dumez@intel.com>
670 Add a StringTypeAdapter for ASCIILiteral
671 https://bugs.webkit.org/show_bug.cgi?id=108338
673 Reviewed by Benjamin Poulain.
675 Add StringTypeAdapter for ASCIILiteral type so that concatenation of an
676 ASCIILiteral and a String using + operator is efficiently handled.
678 * wtf/text/StringConcatenate.h:
679 * wtf/text/StringOperators.h:
680 (WTF::operator+): Inline some of the operator+ functions that were not
684 2013-01-30 David Kilzer <ddkilzer@apple.com>
686 Upstream iOS build file changes for WTF
687 <http://webkit.org/b/108221>
689 Reviewed by Mark Rowe.
691 * Configurations/Base.xcconfig:
692 - Import iOS.xcconfig.
693 - Remove VALID_ARCHS. Modern Xcodes define these correctly.
694 - Make HEADER_SEARCH_PATHS work with iOS Simulator builds.
695 - Add SUPPORTED_PLATFORMS so both Mac and iOS SDKs appear in
697 - Define INSTALL_PATH when building for macosx SDK.
698 * Configurations/CopyWTFHeaders.xcconfig:
699 - Make PRIVATE_HEADERS_FOLDER_PATH work with iOS Simulator
701 * Configurations/DebugRelease.xcconfig:
702 - Simplify ARCHS. This works correctly on 32-bit-only SDKs.
703 * Configurations/WTF.xcconfig:
704 - Fix installation directory for iOS Simulator builds by
705 defining INSTALL_PATH_ACTUAL.
706 * Configurations/iOS.xcconfig: Add.
707 * WTF.xcodeproj/project.pbxproj:
708 - Add iOS.xcconfig to the project.
710 2013-01-29 Mark Hahnenberg <mhahnenberg@apple.com>
712 Structure::m_outOfLineCapacity is unnecessary
713 https://bugs.webkit.org/show_bug.cgi?id=108206
715 Reviewed by Geoffrey Garen.
717 We're adding a new function that gives us the ability to round a value up to the next power of a certain base.
720 (WTF::roundUpToPowerOf):
722 2013-01-30 Zeno Albisser <zeno@webkit.org>
724 [Qt] Fix Qt/Mac build after r141024 and r141037
725 https://bugs.webkit.org/show_bug.cgi?id=108318
727 Reviewed by Kentaro Hara.
730 Make sure Block.h is included and its functionality
731 is enabled for Qt on Mac.
733 2013-01-30 Simon Hausmann <simon.hausmann@digia.com>
735 [Qt] Remove QT4_UNICODE related code paths
736 https://bugs.webkit.org/show_bug.cgi?id=108316
738 Reviewed by Kenneth Rohde Christiansen.
740 Get rid of QT4_UNICODE and any related code paths. The Qt port
741 requires Qt5 and ICU these days.
745 * wtf/unicode/Unicode.h:
746 * wtf/unicode/qt4/UnicodeQt4.h: Removed.
748 2013-01-29 Mark Lam <mark.lam@apple.com>
750 Introducing WTF::TypeSafeEnum and DatabaseError.
751 https://bugs.webkit.org/show_bug.cgi?id=108279.
753 Reviewed by Geoffrey Garen.
755 * WTF.xcodeproj/project.pbxproj:
756 * wtf/TypeSafeEnum.h: Added.
759 (WTF::TypeSafeEnum::TypeSafeEnum):
760 (WTF::TypeSafeEnum::value):
761 (WTF::TypeSafeEnum::operator==):
762 (WTF::TypeSafeEnum::operator!=):
763 (WTF::TypeSafeEnum::operator<):
764 (WTF::TypeSafeEnum::operator<=):
765 (WTF::TypeSafeEnum::operator>):
766 (WTF::TypeSafeEnum::operator>=):
768 2013-01-29 Sheriff Bot <webkit.review.bot@gmail.com>
770 Unreviewed, rolling out r140983.
771 http://trac.webkit.org/changeset/140983
772 https://bugs.webkit.org/show_bug.cgi?id=108277
774 Unfortunately, this API has one last client (Requested by
779 2013-01-28 Benjamin Poulain <benjamin@webkit.org>
781 String constructed from Literals should be non-empty
782 https://bugs.webkit.org/show_bug.cgi?id=108103
784 Reviewed by Eric Carlson.
786 For efficiency, the construction from literal only works with valid non-empty strings.
787 One of the constructor was changed to fix an error from HTMLMediaElement.
789 This patch replaces the branch with an assertions.
791 * wtf/text/StringImpl.cpp:
792 (WTF::StringImpl::createFromLiteral):
794 2013-01-28 David Kilzer <ddkilzer@apple.com>
796 BUILD FIX: Platform.h:1212:22: error: '__MAC_OS_X_VERSION_MIN_REQUIRED' is not defined, evaluates to 0 [-Werror,-Wundef]
798 This fixes the following build error introduced in r140366 for
801 Platform.h:1212:22: error: '__MAC_OS_X_VERSION_MIN_REQUIRED' is not defined, evaluates to 0 [-Werror,-Wundef]
802 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !PLATFORM(IOS)
806 * wtf/Platform.h: Check !PLATFORM(IOS) first so that iOS builds
807 do not try to evaluate __MAC_OS_X_VERSION_MIN_REQUIRED.
809 2013-01-28 Adam Barth <abarth@webkit.org>
811 Remove webkitNotifications.createHTMLNotification
812 https://bugs.webkit.org/show_bug.cgi?id=107598
814 Reviewed by Benjamin Poulain.
818 2013-01-27 Laszlo Gombos <l.gombos@samsung.com>
821 https://bugs.webkit.org/show_bug.cgi?id=108046
823 Reviewed by Adam Barth.
825 HAVE_NMAP -> HAVE_MMAP.
829 2013-01-27 Zoltan Arvai <zarvai@inf.u-szeged.hu>
831 Fixing atomicIncrement implementation for Windows by dropping support before XP SP2.
832 https://bugs.webkit.org/show_bug.cgi?id=106740
834 Reviewed by Benjamin Poulain.
836 Adding int64_t type atomicIncrement and atomicDecrement implementations for Windows
837 into Atomics.h required by WebKit2 after r139514. Separating WinCE implementation
838 that does not support WebKit2 and has no support for 64 bit interlocked methods.
840 Increasing WINVER and _WIN32_WINNT to XP SP2, because the 64 bit type interlocked methods
841 are not supported on previous versions on 32 bit target.
846 (WTF::atomicIncrement):
847 (WTF::atomicDecrement):
849 2013-01-26 Andras Becsi <andras.becsi@digia.com>
851 Unreviewed fix after r140451 to make GIT-SVN repositories happy.
853 * WTF.vcproj/WTF.sln:
855 2013-01-26 Justin Schuh <jschuh@chromium.org>
857 [CHROMIUM] Suppress more c4267 build warnings for Win64 targets
858 https://bugs.webkit.org/show_bug.cgi?id=107993
860 Reviewed by Abhishek Arya.
864 2013-01-25 Eric Seidel <eric@webkit.org>
866 Support 4 and 5 argument bound static functions
867 https://bugs.webkit.org/show_bug.cgi?id=107973
869 Reviewed by Anders Carlsson.
871 Yummy copy/paste template code!
872 I'm about to use this in a BackgroundHTMLParser patch, but figured this should be landed separately.
878 2013-01-24 Martin Robinson <mrobinson@igalia.com>
880 Abstract the logic for appending a UChar32 onto StringBuilder
881 https://bugs.webkit.org/show_bug.cgi?id=107505
883 Reviewed by Darin Adler.
885 * wtf/text/StringBuilder.h:
886 (WTF::StringBuilder::append): Added a method for appending a UChar32 to a StringBuilder.
888 2013-01-24 Brent Fulgham <bfulgham@webkit.org>
890 Stipulate build order between WTFGenerated and WTF
891 https://bugs.webkit.org/show_bug.cgi?id=107844
893 Reviewed by Tim Horton.
895 * WTF.vcxproj/WTF.vcxproj: Use VS2010 project dependency
896 declaration so WTF depends on a completed WTFGenerated build.
898 2013-01-23 Abhishek Arya <inferno@chromium.org>
900 Add support for ASSERT_WITH_SECURITY_IMPLICATION.
901 https://bugs.webkit.org/show_bug.cgi?id=107699
903 Reviewed by Eric Seidel.
905 * wtf/Assertions.h: Add ASSERT_WITH_SECURITY_IMPLICATION to
906 indicate possible security vulnerabily and enable it by default
908 * wtf/Vector.h: Use ASSERT_WITH_SECURITY_IMPLICATION for
909 bounds check on [] operator.
911 2013-01-23 Tony Chang <tony@chromium.org>
913 Unreviewed, set svn:eol-style to CRLF on Windows .sln files.
915 * WTF.vcproj/WTF.sln: Added property svn:eol-style.
917 2013-01-23 Adam Barth <abarth@webkit.org>
919 BackgroundHTMLParser::sendTokensToMainThread should use bind
920 https://bugs.webkit.org/show_bug.cgi?id=107637
922 Reviewed by Eric Seidel.
925 - I had to re-work the approach to validating WeakPtr |this|
926 arguments a bit. Previously you couldn't pass a WeakPtr as a
927 non-|this| argument to a function because we would try to unwrap
928 it into a raw pointer.
930 (WTF::WeakPtrFactory::revokeAll):
932 - Let clients revoke all outstanding WeakPtrs without needing to
933 destroy the WeakPtrFactory.
934 * wtf/chromium/MainThreadChromium.cpp:
935 (WTF::callFunctionObject):
936 (WTF::callOnMainThread):
937 - Implement callOnMainThread for Function objects. The non-Chromium
938 implementation of MainThread.cpp already implements this feature.
940 2013-01-23 Justin Schuh <jschuh@chromium.org>
942 [CHROMIUM] Suppress c4267 build warnings in WTF for Win64 targets
943 https://bugs.webkit.org/show_bug.cgi?id=107721
945 Reviewed by Abhishek Arya.
949 2013-01-23 Oliver Hunt <oliver@apple.com>
951 Add RELEASE_ASSERT (and a few friends)
952 https://bugs.webkit.org/show_bug.cgi?id=107725
954 Reviewed by Filip Pizlo.
956 Adding a few macros to make release mode assertions easier and more readable.
957 Also makes same assertions more useful in debug builds.
961 2013-01-22 Joshua Bell <jsbell@chromium.org>
963 Prevent race condition during Worker shutdown
964 https://bugs.webkit.org/show_bug.cgi?id=107577
966 Reviewed by Dmitry Titov.
968 Add MessageQueue::appendAndKill() which wraps those two steps with a mutex so other
969 threads can't sneak a message in between.
971 * wtf/MessageQueue.h: Added appendAndKill() method.
973 2013-01-22 Roger Fong <roger_fong@apple.com>
975 WTF project files and property sheets for getting WebKit to compile in VS2010.
976 https://bugs.webkit.org/show_bug.cgi?id=106986
978 Reviewed by Timothy Horton and Brent Fulgham.
980 * WTF.vcproj/WTF.sln:
981 * WTF.vcxproj: Added.
982 * WTF.vcxproj/WTF.vcxproj: Added.
983 * WTF.vcxproj/WTF.vcxproj.filters: Added.
984 * WTF.vcxproj/WTF.vcxproj.user: Added.
985 * WTF.vcxproj/WTFCommon.props: Added.
986 * WTF.vcxproj/WTFDebug.props: Added.
987 * WTF.vcxproj/WTFGenerated.make: Added.
988 * WTF.vcxproj/WTFGenerated.vcxproj: Added.
989 * WTF.vcxproj/WTFGenerated.vcxproj.filters: Added.
990 * WTF.vcxproj/WTFGenerated.vcxproj.user: Added.
991 * WTF.vcxproj/WTFGeneratedCommon.props: Added.
992 * WTF.vcxproj/WTFGeneratedDebug.props: Added.
993 * WTF.vcxproj/WTFGeneratedRelease.props: Added.
994 * WTF.vcxproj/WTFPostBuild.cmd: Added.
995 * WTF.vcxproj/WTFPreBuild.cmd: Added.
996 * WTF.vcxproj/WTFPreLink.cmd: Added.
997 * WTF.vcxproj/WTFRelease.props: Added.
998 * WTF.vcxproj/build-generated-files.sh: Added.
999 * WTF.vcxproj/copy-files.cmd: Added.
1000 * WTF.vcxproj/work-around-vs-dependency-tracking-bugs.py: Added.
1003 2013-01-22 David Kilzer <ddkilzer@apple.com>
1005 Fix DateMath.cpp to compile with -Wshorten-64-to-32
1006 <http://webkit.org/b/107503>
1008 Reviewed by Darin Adler.
1010 Fixes the following build errors with -Wshorten-64-to-32:
1012 DateMath.cpp:742:47: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1013 if (month == 2 && day > 28 && !isLeapYear(year))
1015 DateMath.cpp:757:48: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1016 double dateSeconds = ymdhmsToSeconds(year, month, day, hours, minutes, seconds) - timeZoneSeconds;
1017 ~~~~~~~~~~~~~~~ ^~~~~
1018 DateMath.cpp:757:55: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1019 double dateSeconds = ymdhmsToSeconds(year, month, day, hours, minutes, seconds) - timeZoneSeconds;
1021 DateMath.cpp:757:60: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1022 double dateSeconds = ymdhmsToSeconds(year, month, day, hours, minutes, seconds) - timeZoneSeconds;
1023 ~~~~~~~~~~~~~~~ ^~~~~
1024 DateMath.cpp:757:67: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1025 double dateSeconds = ymdhmsToSeconds(year, month, day, hours, minutes, seconds) - timeZoneSeconds;
1026 ~~~~~~~~~~~~~~~ ^~~~~~~
1027 DateMath.cpp:996:59: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1028 offset = ((o / 100) * 60 + (o % 100)) * sgn;
1029 ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
1030 DateMath.cpp:998:37: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1031 offset = o * 60 * sgn;
1033 DateMath.cpp:1005:40: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1034 offset = (o * 60 + o2) * sgn;
1035 ~ ~~~~~~~~~~~~~~^~~~~
1036 DateMath.cpp:1041:40: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1037 return ymdhmsToSeconds(year, month + 1, day, hour, minute, second) * msPerSecond;
1038 ~~~~~~~~~~~~~~~ ~~~~~~^~~
1039 DateMath.cpp:1041:45: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1040 return ymdhmsToSeconds(year, month + 1, day, hour, minute, second) * msPerSecond;
1042 DateMath.cpp:1041:50: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1043 return ymdhmsToSeconds(year, month + 1, day, hour, minute, second) * msPerSecond;
1044 ~~~~~~~~~~~~~~~ ^~~~
1045 DateMath.cpp:1041:56: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
1046 return ymdhmsToSeconds(year, month + 1, day, hour, minute, second) * msPerSecond;
1047 ~~~~~~~~~~~~~~~ ^~~~~~
1048 12 errors generated.
1051 (WTF::ymdhmsToSeconds): Change year argument from long to int.
1052 Change mon, day, hour, minute arguments from int to long.
1053 (WTF::parseInt): Add. Identical to parseLong but bounds checks
1055 (WTF::parseLong): Switch to std::numeric_limits<long> instead of
1057 (WTF::parseES5DatePortion): Change year argument from long to
1059 (WTF::parseES5DateFromNullTerminatedCharacters): Change year
1060 local variable from long to int.
1061 (WTF::parseDateFromNullTerminatedCharacters): Change year and
1062 offset local variables from long to int. Switch from using
1063 parseLong() to parseInt() as needed. Ditto for labs() to abs().
1064 Add overflow check when switching from "MM/DD/YYYY" to
1065 "YYYY/MM/DD" parsing.
1067 2013-01-17 Andy Estes <aestes@apple.com>
1069 Add a USE() macro for content filtering code
1070 https://bugs.webkit.org/show_bug.cgi?id=107098
1072 Reviewed by Mark Rowe.
1074 * wtf/Platform.h: Define WTF_USE_CONTENT_FILTERING on Mac platforms
1075 more recent than Lion.
1077 2013-01-18 Laszlo Gombos <l.gombos@samsung.com>
1079 Remove unnecessary PLATFORM() tests
1080 https://bugs.webkit.org/show_bug.cgi?id=107360
1082 Reviewed by Eric Seidel.
1084 PLATFORM(WIN), PLATFORM(CHROMIUM) and PLATFORM(QT) are mutually
1085 exclusive. Remove redundant PLATFORM() tests based on this
1090 2013-01-18 Laszlo Gombos <l.gombos@samsung.com>
1092 Remove PLATFORM(TORCHMOBILE) from Assertions.h
1093 https://bugs.webkit.org/show_bug.cgi?id=107355
1095 Reviewed by Eric Seidel.
1097 This appears to be the only place where PLATFORM(TORCHMOBILE) is
1098 used. I don't believe this ifdef is needed anymore.
1102 2013-01-18 Michael Saboff <msaboff@apple.com>
1104 Refactor isPowerOf2() and add getLSBSet()
1105 https://bugs.webkit.org/show_bug.cgi?id=107306
1107 Reviewed by Filip Pizlo.
1109 Moved runtime/PropertyMapHashTable.h:PowerOf2() to new hasOneBitSet() and added getLSBSet().
1115 2013-01-18 David Kilzer <ddkilzer@apple.com>
1117 Fix WTF::copyLCharsFromUCharSource() to compile with -Wshorten-64-to-32
1118 <http://webkit.org/b/107227>
1120 Reviewed by Benjamin Poulain.
1122 Fixes the following build error:
1124 ASCIIFastPath.h:117:59: error: implicit conversion loses integer precision: 'unsigned long' to 'const unsigned int' [-Werror,-Wshorten-64-to-32]
1125 const unsigned endLength = length - ucharsPerLoop + 1;
1126 ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~
1129 * wtf/text/ASCIIFastPath.h:
1130 (WTF::copyLCharsFromUCharSource): Change local variables from
1133 2013-01-14 Dominik Röttsches <dominik.rottsches@intel.com>
1135 [EFL] Update freetype in jhbuild to 2.4.11 and activate subpixel layout
1136 https://bugs.webkit.org/show_bug.cgi?id=106774
1138 In order to fix a long standing linespacing/font ascent & descent issue
1139 we found that FreeType commit b0962ac34e660 solves that problem.
1140 Let's update FreeType accordingly, but bump it to 2.4.11 due to the
1141 maintainer recommending several security updates after that said commit.
1143 Also, in order to avoid extra rebaselining, let's activate subpixel
1144 layout at the same time.
1146 Reviewed by Martin Robinson.
1148 * wtf/Platform.h: Activate Subpixel Layout for EFL.
1150 2013-01-17 Adam Barth <abarth@webkit.org>
1152 Teach Functional.h about WeakPtr
1153 https://bugs.webkit.org/show_bug.cgi?id=107105
1155 Reviewed by Anders Carlsson.
1157 A common pattern in cross-thread communication is to call member
1158 functions of an object on a remote thread. If the caller's reference to
1159 the object on the remote thread is a WeakPtr, the caller usually wants
1160 to validate that the object still exists when the call actually takes
1163 It's possible to do this manually for every cross-thread call, but that
1164 is tiresome and error prone. Instead, we can teach bind to validate
1165 WeakPtr arguments when passed as the "this" parameter to a member
1169 (WTF::ParamStorageTraits::validate):
1171 2013-01-17 David Kilzer <ddkilzer@apple.com>
1173 Fix vprintf_stderr_common() to compile with -Wshorten-64-to-32
1174 <http://webkit.org/b/107126>
1176 Reviewed by Darin Adler.
1178 Fixes the following build error:
1180 Assertions.cpp:92:22: error: implicit conversion loses integer precision: 'CFIndex' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
1181 int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
1182 ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1185 * wtf/Assertions.cpp:
1186 (vprintf_stderr_common): Use CFIndex type instead of int for the
1187 return value of CFStringGetMaximumSizeForEncoding().
1189 2013-01-17 Zan Dobersek <zdobersek@igalia.com>
1191 [Autotools] Unify WTF sources list regardless of the target OS, Unicode backend
1192 https://bugs.webkit.org/show_bug.cgi?id=105886
1194 Reviewed by Gustavo Noronha Silva.
1196 Rather than including files in the sources list in an OS-specific way,
1197 guard specific files with OS(UNIX|WINDOWS), USE((GLIB|ICU)_UNICODE) guards
1198 and include all of them in the list.
1200 Proper comments for namespace and #if guard closings are also added or adjusted
1201 where necessary in the affected files.
1203 * GNUmakefile.list.am:
1204 * wtf/OSAllocatorPosix.cpp: Add OS(UNIX) guards.
1205 * wtf/OSAllocatorWin.cpp: Add OS(WINDOWS) guards.
1206 * wtf/ThreadSpecificWin.cpp: Ditto.
1207 * wtf/ThreadingWin.cpp: Ditto.
1208 * wtf/unicode/glib/UnicodeGLib.cpp: Add USE(GLIB_UNICODE) guards.
1210 * wtf/unicode/glib/UnicodeGLib.h: Ditto.
1212 * wtf/unicode/icu/CollatorICU.cpp: Style changes.
1213 * wtf/unicode/icu/UnicodeIcu.h: Add USE(ICU_UNICODE) guards.
1215 * wtf/win/OwnPtrWin.cpp: Add OS(WINDOWS) guards.
1217 2013-01-16 Benjamin Poulain <benjamin@webkit.org>
1219 Use GCC's implementation of atomicIncrement/Decrement on Mac
1220 https://bugs.webkit.org/show_bug.cgi?id=106976
1222 Reviewed by Filip Pizlo.
1225 GCC and LLVM have builtin for atomic ADD and SUB: __sync_add_and_fetch,
1226 __sync_sub_and_fetch.
1228 Using them let the compiler just generate the atomic operations inline
1229 instead of generating a function call to LibC. It also simplify the
1232 2013-01-15 Adam Barth <abarth@webkit.org>
1234 Generalize DocumentWeakReference into WTF::WeakPtr
1235 https://bugs.webkit.org/show_bug.cgi?id=106854
1237 Reviewed by Darin Adler.
1239 This patch adds a simple WeakPtr object to WTF. To use WeakPtr, objects
1240 must hold a WeakPtrFactory member variable, which clears the WeakPtrs
1241 when the object is destructed. The underlying storage is a
1242 ThreadSafeRefCounted "WeakReference" object, which is shared by all the
1245 WeakPtr is a generalization of DocumentWeakReference, which is used to
1246 check whether the Document object is alive when tasks arive on the main
1247 thread from worker threads. We plan to use a similar pattern in the
1248 threaded HTML parser, but we want to send tasks to objects other than
1251 * GNUmakefile.list.am:
1254 * WTF.vcproj/WTF.vcproj:
1255 * WTF.xcodeproj/project.pbxproj:
1256 * wtf/CMakeLists.txt:
1257 * wtf/WeakPtr.h: Added.
1259 - The ThreadSafeRefCounted object shared by all the WeakPtr
1260 instances. This patch uses ThreadSafeRefCounted so that we can
1261 use WeakPtrs to cancel cross-thread messages.
1262 (WTF::WeakReference::create):
1263 (WTF::WeakReference::get):
1264 (WTF::WeakReference::clear):
1265 - When the object is destroyed, WeakPtrFactory calls this function
1266 to clear all the WeakPtrs.
1267 (WTF::WeakReference::WeakReference):
1268 (WTF::WeakPtr::WeakPtr):
1269 (WTF::WeakPtr::get):
1270 - We might want to add implicit conversions and Boolean operators
1271 in the future, but I've kept this class simple for now.
1272 (WTF::WeakPtrFactory::WeakPtrFactory):
1273 (WTF::WeakPtrFactory::~WeakPtrFactory):
1274 (WTF::WeakPtrFactory::createWeakPtr):
1276 2013-01-12 Csaba Osztrogonác <ossy@webkit.org>
1278 Use __sync_add_and_fetch instead of __gnu_cxx::__exchange_and_add
1279 https://bugs.webkit.org/show_bug.cgi?id=106729
1281 After r139514 we need atomicIncrement(int64_t volatile*) for all platform. Now the
1282 GCC implementation of atomicIncrement() is based on __gnu_cxx::__exchange_and_add,
1283 which doesn't support int64_t type, but __sync_add_and_fetch does.
1285 Reviewed by Benjamin Poulain.
1288 (WTF::atomicIncrement):
1289 (WTF::atomicDecrement):
1291 2013-01-11 Filip Pizlo <fpizlo@apple.com>
1293 Add WTF_EXPORT_PRIVATE to printInternal() methods of PrintStream.h
1295 Rubber stamped by Mark Hahnenberg.
1297 This will make it easier to use dataLog() from WebCore.
1299 * wtf/PrintStream.h:
1302 2013-01-09 Antti Koivisto <antti@apple.com>
1304 Release FastMalloc thread caches on memory warning
1305 https://bugs.webkit.org/show_bug.cgi?id=106471
1307 Reviewed by Geoff Garen.
1309 Use TCMalloc_ThreadCache::Cleanup() instead of calling Scavenge() twice. This releases all the memory
1310 and looks nicer too.
1312 * wtf/FastMalloc.cpp:
1313 (WTF::releaseFastMallocFreeMemory):
1315 2013-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
1317 Unreviewed. Fix make distcheck.
1319 * GNUmakefile.list.am: Add missing header.
1321 2013-01-07 Filip Pizlo <fpizlo@apple.com>
1323 Rationalize closure call heuristics and profiling
1324 https://bugs.webkit.org/show_bug.cgi?id=106270
1326 Reviewed by Oliver Hunt.
1328 Add a macro to add a method to a class that returns a dumper. Allows you to have
1329 secondary dump() methods for dumping either more or less information.
1331 * wtf/PrintStream.h:
1334 2013-01-07 Ryosuke Niwa <rniwa@webkit.org>
1336 Sorted the xcodeproj file.
1338 * WTF.xcodeproj/project.pbxproj:
1340 2013-01-07 Filip Pizlo <fpizlo@apple.com>
1342 Unreviewed, it should be possible to build JSC on ARM.
1344 * wtf/FastMalloc.cpp:
1345 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
1347 2013-01-07 Balazs Kilvady <kilvadyb@homejinni.com>
1349 MIPS LLInt implementation.
1350 https://bugs.webkit.org/show_bug.cgi?id=99706
1352 Reviewed by Filip Pizlo.
1354 LLInt implementation for MIPS.
1358 2013-01-05 Jonathan Liu <net147@gmail.com>
1360 Only enable MinGW-w64 pow() workaround if needed
1361 https://bugs.webkit.org/show_bug.cgi?id=106099
1363 Reviewed by Filip Pizlo.
1365 The pow() workaround is no longer needed in the latest version
1370 2013-01-05 Jonathan Liu <net147@gmail.com>
1372 Fix compilation of MathExtras.h with MinGW-w64
1373 https://bugs.webkit.org/show_bug.cgi?id=106105
1375 Reviewed by Simon Hausmann.
1377 The isfinite and isinf functions are required by wtf_pow but
1378 not defined until after wtf_pow. Move wtf_pow to after
1379 "using std::isfinite" and "using std::isinf" to fix compilation.
1384 2013-01-03 Filip Pizlo <fpizlo@apple.com>
1386 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
1387 https://bugs.webkit.org/show_bug.cgi?id=106027
1389 Reviewed by Mark Hahnenberg.
1391 I got tired of the various idioms for printing a list of things with comma in between, so I wrote a helper.
1393 * WTF.xcodeproj/project.pbxproj:
1394 * wtf/CommaPrinter.h: Added.
1397 (WTF::CommaPrinter::CommaPrinter):
1398 (WTF::CommaPrinter::dump):
1400 2013-01-02 Simon Hausmann <simon.hausmann@digia.com>
1402 [MinGW-w64] Centralize workaround for pow() implementation
1403 https://bugs.webkit.org/show_bug.cgi?id=105925
1405 Reviewed by Sam Weinig.
1407 As suggested by Sam, move the MinGW-w64 workaround into MathExtras.h
1408 away from the JSC usage.
1413 2013-01-02 Adam Barth <abarth@webkit.org>
1415 WTF.gypi lists Platform.h twice
1416 https://bugs.webkit.org/show_bug.cgi?id=105731
1418 Reviewed by Tony Chang.
1420 Once ought to be enough for everybody.
1424 2012-12-31 Gavin Barraclough <barraclough@apple.com>
1426 Objective-C API for JavaScriptCore
1427 https://bugs.webkit.org/show_bug.cgi?id=105889
1429 Reviewed by Filip Pizlo.
1431 * wtf/WTFThreadData.cpp:
1432 (WTF::WTFThreadData::WTFThreadData):
1433 * wtf/WTFThreadData.h:
1435 - Added m_apiData - provide convenient storage for use by the API.
1437 2012-12-28 Ilya Tikhonovsky <loislo@chromium.org>
1439 Web Inspector: Native Memory Instrumentation: instrument not instrumented members.
1440 https://bugs.webkit.org/show_bug.cgi?id=105830
1442 Reviewed by Vsevolod Vlasov.
1444 In some cases we don't want to visit some class members.
1445 As example we decided to skip pointers to interface classes such as GraphicLayerClient.
1446 We could use addWeakPointer for them but it can't be used for nonpointer members.
1447 In the offline discussion we came to a conclusion that we need a new instrumentation
1448 method ignoreMember, which will be used for all the members which we won't like to visit/instrument.
1450 DriveBy: Also I instrumented not yet instrumented members.
1452 * wtf/MemoryInstrumentation.h:
1454 (WTF::MemoryClassInfo::ignoreMember):
1456 2012-12-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1458 Fix build warning in OSAllocatorPosix.cpp
1459 https://bugs.webkit.org/show_bug.cgi?id=105761
1461 Reviewed by Kentaro Hara.
1463 * wtf/OSAllocatorPosix.cpp:
1464 (WTF::OSAllocator::reserveUncommitted): Fix unused param warnings.
1466 2012-12-24 Yury Semikhatsky <yurys@chromium.org>
1468 Memory instrumentation: provide a way to mark a node as a root
1469 https://bugs.webkit.org/show_bug.cgi?id=105737
1471 Reviewed by Alexander Pavlov.
1473 Objects added using MemoryInstrumentation::addRootObject will be marked as roots.
1475 * wtf/MemoryInstrumentation.cpp:
1476 (WTF::MemoryInstrumentation::WrapperBase::process):
1478 (WTF::MemoryInstrumentation::WrapperBase::processPointer):
1479 (WTF::MemoryInstrumentation::WrapperBase::processRootObjectRef):
1480 * wtf/MemoryInstrumentation.h:
1482 * wtf/MemoryObjectInfo.h: added root marker which can be used by the heap graph builder.
1483 (WTF::MemoryObjectInfo::MemoryObjectInfo):
1484 (WTF::MemoryObjectInfo::isRoot):
1485 (WTF::MemoryObjectInfo::markAsRoot):
1488 2012-12-24 Ilya Tikhonovsky <loislo@chromium.org>
1490 Web Inspector: Native Memory Instrumentation: propagate member type as edge type to the serialized heap graph.
1491 https://bugs.webkit.org/show_bug.cgi?id=105725
1493 Reviewed by Yury Semikhatsky.
1495 MemoryOwningType was renamed to MemberType.
1496 Source argument were removed from reportEdge, reportLeaf and other edge related methods because it is not necessary.
1497 MemberType argument was propagated from MemoryInstrumentation down to HeapGraphSerializer.
1499 The changes covered by tests in TestWebKitAPI.
1501 * wtf/MemoryInstrumentation.cpp:
1502 (WTF::MemoryInstrumentation::reportEdge):
1503 (WTF::MemoryInstrumentation::reportLinkToBuffer):
1504 (WTF::MemoryClassInfo::addPrivateBuffer):
1505 * wtf/MemoryInstrumentation.h:
1506 (MemoryInstrumentationClient):
1507 (MemoryInstrumentation):
1508 (WTF::MemoryInstrumentation::addRawBuffer):
1509 (WTF::MemoryInstrumentation::MemberTypeTraits::addObject):
1510 (WTF::MemoryInstrumentation::addObjectImpl):
1512 2012-12-21 Ilya Tikhonovsky <loislo@chromium.org>
1514 Unreviewed. Another try to fix Apple Win Release build.
1516 * wtf/FastMalloc.cpp:
1519 2012-12-21 Ilya Tikhonovsky <loislo@chromium.org>
1521 Unreviewed compilation fix for Apple Win Release after r138398.
1523 * wtf/FastMalloc.cpp:
1526 2012-12-21 Oliver Hunt <oliver@apple.com>
1528 Further harden FastMalloc
1529 https://bugs.webkit.org/show_bug.cgi?id=105656
1531 Reviewed by Gavin Barraclough.
1533 This increases the degree to which we harden the FastMalloc
1534 linked lists. We now also mask the previous and next pointers
1535 in the doubly linked list implementation. I've also made
1536 the masking itself somewhat more complex without a measurable
1537 cost. We still use ASLR to provide some general entropy, but
1538 we blind the pointers against each nodes 'this' pointer.
1540 * wtf/FastMalloc.cpp:
1546 (WTF::Span::setNext):
1547 (WTF::Span::setPrev):
1549 As Span now has to do masking on the next and previous pointers,
1550 I've updated the code to use accessors instead.
1556 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects):
1557 (WTF::TCMalloc_PageHeap::scavenge):
1558 (WTF::TCMalloc_PageHeap::New):
1559 (WTF::TCMalloc_PageHeap::AllocLarge):
1560 (WTF::TCMalloc_PageHeap::ReturnedBytes):
1561 (WTF::TCMalloc_PageHeap::Check):
1562 (WTF::TCMalloc_PageHeap::CheckList):
1563 (WTF::TCMalloc_PageHeap::ReleaseFreeList):
1564 (WTF::TCMalloc_Central_FreeList::FetchFromSpans):
1566 2012-12-20 Ryuan Choi <ryuan.choi@samsung.com>
1568 [EFL] Build break with latest EFL libraries.
1569 https://bugs.webkit.org/show_bug.cgi?id=104827
1571 Reviewed by Laszlo Gombos.
1573 The eo EFL package is introduced and evas and ecore use it since 1.8.
1574 While introducing Eo, EFL changed several structures of Evas and Ecore
1575 from own specific class to Eo.
1577 So, this patch adds FindEo and changes declaration of Evas, Evas_Object,
1578 Ecore_Timer to build with latest EFL libraries.
1580 * wtf/OwnPtrCommon.h: Modified declaration of Evas_Object and Ecore_Timer.
1581 * wtf/PlatformEfl.cmake: Includes eo EFL library.
1582 * wtf/efl/RefPtrEfl.h: Modified declaration of Evas_Object.
1584 2012-12-20 Oliver Hunt <oliver@apple.com>
1586 Harden pointers in FastMalloc's singly linked list implementation
1587 https://bugs.webkit.org/show_bug.cgi?id=105571
1589 Reviewed by Gavin Barraclough.
1591 Add simple xor based hardening of the next pointer in the
1592 fast malloc singly linked list implementation. We rely on
1593 ASLR to introduce the address randomness we want for the mask.
1594 Happily this produces a very low cost random value to use.
1596 * wtf/FastMalloc.cpp:
1601 2012-12-19 Oliver Hunt <oliver@apple.com>
1603 StringImpl isolatedCopy unnecessarily copies text-segment character data
1604 https://bugs.webkit.org/show_bug.cgi?id=105376
1606 Reviewed by Anders Carlsson.
1608 This patch adds a new (private) helper to StringImpl that tests whether the StringImpl
1609 is backed by an ASCII literal. This allows isolatedCopy() to safely use the createFromLiteral
1610 constructor rather than making an unnecessary copy.
1612 * wtf/text/StringImpl.h:
1614 (WTF::StringImpl::isASCIILiteral):
1615 (WTF::StringImpl::isolatedCopy):
1617 2012-12-19 Oliver Hunt <oliver@apple.com>
1619 WTF String from ASCIILiteral fails to correctly handle empty strings.
1620 https://bugs.webkit.org/show_bug.cgi?id=105453
1622 Reviewed by Anders Carlsson.
1624 When we have an zero length literal we should return the empty StringImpl.
1626 * wtf/text/StringImpl.cpp:
1627 (WTF::StringImpl::createFromLiteral):
1629 2012-12-18 Yury Semikhatsky <yurys@chromium.org>
1631 Web Inspector: show cached images under MemoryCache -> Images section
1632 https://bugs.webkit.org/show_bug.cgi?id=105261
1634 Reviewed by Pavel Feldman.
1636 Use first provided name and class name. If one of the ancestors tries to overwrite
1637 it just ignore the call.
1639 * wtf/MemoryObjectInfo.h:
1640 (WTF::MemoryObjectInfo::setClassName):
1641 (WTF::MemoryObjectInfo::setName):
1643 2012-12-18 Uli Schlachter <psychon@znc.in>
1645 Implement uncommitted memory for Linux.
1646 https://bugs.webkit.org/show_bug.cgi?id=65766
1648 Reviewed by Simon Hausmann.
1650 The old approach used MAP_NORESERVE to allocate address space without
1651 committing it. However, that flag gets ignored if
1652 /proc/sys/vm/overcommit_memory is set to 2. The new approach uses a
1653 mapping with PROT_NONE. This works because mappings which aren't even
1654 readable don't get accounted as committed on Linux.
1656 * wtf/OSAllocatorPosix.cpp:
1657 (WTF::OSAllocator::reserveUncommitted):
1658 (WTF::OSAllocator::reserveAndCommit):
1659 (WTF::OSAllocator::commit):
1660 (WTF::OSAllocator::decommit):
1662 2012-12-17 Ilya Tikhonovsky <loislo@chromium.org>
1664 Web Inspector: Native Memory Instrumentation: MemoryInstrumentation doesn't detect reportMemoryUsage method defined in a base class.
1665 https://bugs.webkit.org/show_bug.cgi?id=105026
1667 Reviewed by Yury Semikhatsky.
1669 Old SFINAE test was replaced with new one based on this article:
1670 http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions
1672 * wtf/MemoryInstrumentation.h:
1673 (MemoryInstrumentation):
1677 (WTF::MemoryInstrumentation::IsInstrumented::BaseMixin::reportMemoryUsage):
1678 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
1679 (InstrumentationSelector):
1681 (WTF::::reportObjectMemoryUsage):
1683 2012-12-17 Ilya Tikhonovsky <loislo@chromium.org>
1685 Unreviewed, rolling out r137892.
1686 http://trac.webkit.org/changeset/137892
1687 https://bugs.webkit.org/show_bug.cgi?id=105026
1689 it broke compilation on windows
1691 * wtf/MemoryInstrumentation.h:
1692 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
1693 (MemoryInstrumentation):
1694 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
1695 (WTF::reportMemoryUsage):
1697 2012-12-14 Ilya Tikhonovsky <loislo@chromium.org>
1699 Web Inspector: Native Memory Instrumentation: MemoryInstrumentation doesn't detect reportMemoryUsage method defined in a base class.
1700 https://bugs.webkit.org/show_bug.cgi?id=105026
1702 Reviewed by Yury Semikhatsky.
1704 Old SFINAE test was replaced with new one based on this article:
1705 http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions
1707 * wtf/MemoryInstrumentation.h:
1708 (MemoryInstrumentation):
1712 (WTF::MemoryInstrumentation::IsInstrumented::BaseMixin::reportMemoryUsage):
1713 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
1714 (InstrumentationSelector):
1716 (WTF::::reportObjectMemoryUsage):
1718 2012-12-14 Yury Semikhatsky <yurys@chromium.org>
1720 Web Inspector: add data grid for exploring native heap graph
1721 https://bugs.webkit.org/show_bug.cgi?id=105012
1723 Reviewed by Pavel Feldman.
1725 Do not report edges with null target.
1727 * wtf/MemoryInstrumentation.h:
1728 (WTF::MemoryInstrumentation::addObjectImpl):
1730 2012-12-13 Filip Pizlo <fpizlo@apple.com>
1732 Attempt to rationalize and simplify WTF::binarySearch
1733 https://bugs.webkit.org/show_bug.cgi?id=104890
1735 Reviewed by Maciej Stachowiak.
1737 Binary search now has three modes:
1739 The default: assert that the key was found, but return an adjacent element if it
1740 wasn't found, if asserts are turned off.
1742 tryBinarySearch: return 0 if the key wasn't found.
1744 approximateBinarySearch: if the key is not found, return an adjacent element (either
1745 the left or right; no guarantee which).
1747 This also reduces the number of variants of binarySearch. The functor variant is now
1748 gone because binarySearch now always uses a functor for the key extractor. The
1749 generic variant is now gone because binarySearch always expects an array type that
1752 * wtf/StdLibExtras.h:
1753 (WTF::binarySearchImpl):
1754 (WTF::binarySearch):
1755 (WTF::tryBinarySearch):
1756 (WTF::approximateBinarySearch):
1758 2012-12-13 Ilya Tikhonovsky <loislo@chromium.org>
1760 Web Inspector: Native Memory Instrumentation: do not validate pointers to objects in RenderArena agains tcmalloc data.
1761 https://bugs.webkit.org/show_bug.cgi?id=104903
1763 Reviewed by Yury Semikhatsky.
1765 This is a simplest approach to do that with zero performance overhead.
1767 * wtf/MemoryInstrumentation.cpp:
1768 (WTF::MemoryClassInfo::setCustomAllocation):
1770 * wtf/MemoryInstrumentation.h:
1772 * wtf/MemoryObjectInfo.h:
1773 (WTF::MemoryObjectInfo::MemoryObjectInfo):
1774 (WTF::MemoryObjectInfo::customAllocation):
1775 (WTF::MemoryObjectInfo::setCustomAllocations):
1778 2012-12-12 Ilya Tikhonovsky <loislo@chromium.org>
1780 Web Inspector: Native Memory Instrumentation: remove fake root MemoryObjectInfo.
1781 https://bugs.webkit.org/show_bug.cgi?id=104796
1783 Reviewed by Yury Semikhatsky.
1785 It was not a good idea to introduce a fake root MemoryObjectInfo.
1786 It makes a problem when we visit an object without its own MemoryObjectType.
1788 Example: RenderBox has a global pointer to a hash map.
1789 HashMap doesn't have its own object type because it is a generic container.
1790 It will inherit object type from the fake root memory object info.
1791 The same could happen for another container in another class with other MemoryObjectType.
1793 This fact forces me to create custom process method for root objects
1794 because they need to have their own MemoryObjectInfo with customisable memory object type.
1796 Drive by fix: InstrumentedPointer* was replaced with Wrapper* because actually it is using
1797 for instrumented and not instrumented object classes.
1799 * wtf/MemoryInstrumentation.cpp:
1800 (WTF::MemoryInstrumentation::MemoryInstrumentation):
1801 (WTF::MemoryInstrumentation::WrapperBase::WrapperBase):
1802 (WTF::MemoryInstrumentation::WrapperBase::process):
1803 (WTF::MemoryInstrumentation::WrapperBase::processRootObjectRef):
1805 * wtf/MemoryInstrumentation.h:
1806 (WTF::MemoryInstrumentation::addRootObject):
1807 (MemoryInstrumentation):
1809 (WTF::MemoryInstrumentation::WrapperBase::~WrapperBase):
1812 (WTF::MemoryInstrumentation::OwningTraits::addRootObject):
1813 (WTF::MemoryInstrumentation::addObjectImpl):
1815 (WTF::::callReportMemoryUsage):
1817 2012-12-12 Sergio Martins <sergio.martins@kdab.com>
1819 Fix QNX Qt build by enabling JIT.
1820 https://bugs.webkit.org/show_bug.cgi?id=102794
1822 Reviewed by Simon Hausmann.
1824 JIT is working, so enable it. Otherwise LLINT gets enabled, and
1825 that doesn't compile.
1827 YARR_JIT is crashing at this time though, so disable it.
1831 2012-12-11 Ilya Tikhonovsky <loislo@chromium.org>
1833 Web Inspector: Native Memory Instrumentation: simplify Sequences processing code.
1834 https://bugs.webkit.org/show_bug.cgi?id=104777
1836 Reviewed by Yury Semikhatsky.
1838 Redesign reportMemoryUsage for the sequences.
1839 With the old schema we couldn't instrument HashMap<key, WebCore::LayoutUnit>
1840 because LayoutUnit has overloaded conversion operators for double, int, etc.
1841 I wrote an empty SequenceMemoryInstrumentationTraits for LayoutUnit class
1842 but it doesn't help because the root of problem was hidden in the free template function reportSequenceMemoryUsage.
1843 I could overload reportSequenceMemoryUsage too but in this case I need to fully specify all the types
1844 for the iterators like HashMap<.....>::const_iterator. Too many letters.
1845 I found a better solution. Free reportSequenceMemoryUsage can be converted into default implementation of static
1846 reportMemoryUsage traits method. In this case the types of iterators will be inferred automaticaly. The old default
1847 implementation becomes a custom implementation for the user defined types.
1849 * wtf/MemoryInstrumentationHashCountedSet.h:
1850 (WTF::reportMemoryUsage):
1851 * wtf/MemoryInstrumentationHashMap.h:
1852 (WTF::reportMemoryUsage):
1853 * wtf/MemoryInstrumentationHashSet.h:
1854 (WTF::reportMemoryUsage):
1855 * wtf/MemoryInstrumentationListHashSet.h:
1856 (WTF::reportMemoryUsage):
1857 * wtf/MemoryInstrumentationSequence.h:
1859 (WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
1860 (SequenceMemoryInstrumentationTraits):
1861 * wtf/MemoryInstrumentationVector.h:
1862 (WTF::reportMemoryUsage):
1864 2012-12-10 Yury Semikhatsky <yurys@chromium.org>
1866 Memory instrumentation: make sure each edge is reported only once
1867 https://bugs.webkit.org/show_bug.cgi?id=104630
1869 Reviewed by Pavel Feldman.
1871 Make sure that outgoing edges are reported only once if we come to the same
1872 object twice: first by an address of a base class and then by a real address
1875 * wtf/MemoryInstrumentation.cpp:
1876 (WTF::MemoryInstrumentation::MemoryInstrumentation):
1877 (WTF::MemoryInstrumentation::reportLinkToBuffer):
1878 (WTF::MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase):
1879 (WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
1880 (WTF::MemoryClassInfo::init):
1881 (WTF::MemoryClassInfo::addRawBuffer):
1882 (WTF::MemoryClassInfo::addPrivateBuffer):
1883 * wtf/MemoryInstrumentation.h:
1884 (InstrumentedPointerBase):
1885 (MemoryInstrumentation):
1886 (InstrumentedPointer):
1887 (WTF::MemoryClassInfo::MemoryClassInfo):
1888 (WTF::MemoryClassInfo::addMember):
1890 (WTF::::InstrumentedPointer):
1891 (WTF::::callReportMemoryUsage):
1892 * wtf/MemoryObjectInfo.h:
1893 (WTF::MemoryObjectInfo::MemoryObjectInfo):
1894 (WTF::MemoryObjectInfo::firstVisit):
1895 (WTF::MemoryObjectInfo::className):
1896 (WTF::MemoryObjectInfo::name):
1897 (WTF::MemoryObjectInfo::setAlreadyVisited):
1900 2012-12-10 Benjamin Poulain <benjamin@webkit.org>
1902 Add convenience methods to use ListHashSet for a LRU cache
1903 https://bugs.webkit.org/show_bug.cgi?id=104499
1905 Reviewed by Sam Weinig.
1907 ListHashSet is a great abstract data type to implement caches.
1908 Unfortunately, the class was missing methods to do that easily and
1909 efficiently. This patch fixes that.
1911 The names appendOrMoveToLast() and prependOrMoveToFirst() were chosen
1912 in favor of append()/prepend() to ensure they are not used in place of
1915 * wtf/ListHashSet.h:
1917 (WTF::::removeFirst):
1918 (WTF::::appendOrMoveToLast):
1919 (WTF::::prependOrMoveToFirst):
1921 (WTF::::unlinkAndDelete):
1922 (WTF::::prependNode):
1924 2012-12-10 Eric Carlson <eric.carlson@apple.com>
1926 Add support for in-band text tracks to Mac port
1927 https://bugs.webkit.org/show_bug.cgi?id=103663
1929 Reviewed by Sam Weinig.
1931 * wtf/Platform.h: Define HAVE_AVFOUNDATION_TEXT_TRACK_SUPPORT.
1933 2012-12-08 Patrick Gansterer <paroga@webkit.org>
1935 Compiling WTF outside of WebKit failed on Windows
1936 https://bugs.webkit.org/show_bug.cgi?id=100201
1938 Reviewed by Darin Adler.
1940 Explicitly use the Unicode variants of the Windows API to
1941 allow building the WTF library without the UNICODE define.
1943 * wtf/win/MainThreadWin.cpp:
1944 (WTF::initializeMainThreadPlatform):
1946 2012-12-08 Gustavo Noronha Silva <gns@gnome.org>
1948 Unreviewed trivial space fix to silence an automake warning.
1950 * GNUmakefile.list.am:
1952 2012-12-05 Halton Huo <halton.huo@intel.com>
1954 [CMake] Unify coding style for CMake files
1955 https://bugs.webkit.org/show_bug.cgi?id=103605
1957 Reviewed by Laszlo Gombos.
1959 Update cmake files(.cmake, CMakeLists.txt) with following style rules:
1961 1.1 Use spaces, not tabs.
1962 1.2 Four spaces as indent.
1964 2.1 Place one space between control statements and their parentheses.
1965 For eg, if (), else (), elseif (), endif (), foreach (),
1966 endforeach (), while (), endwhile (), break ().
1967 2.2 Do not place spaces between function and macro statements and
1968 their parentheses. For eg, macro(), endmacro(), function(),
1970 2.3 Do not place spaces between a command or function or macro and its
1971 parentheses, or between a parenthesis and its content. For eg,
1972 message("testing") not message( "testing") or message ("testing" )
1973 2.4 No space at line ending.
1974 3. Lowercase when call commands macros and functions. For eg,
1975 add_executable() not ADD_EXECUTABLE(), set() not SET().
1978 * wtf/CMakeLists.txt:
1979 * wtf/PlatformBlackBerry.cmake:
1980 * wtf/PlatformEfl.cmake:
1981 * wtf/PlatformWinCE.cmake:
1983 2012-12-04 Jon Lee <jonlee@apple.com>
1985 Extend StringHasher to take a stream of characters
1986 https://bugs.webkit.org/show_bug.cgi?id=104076
1987 <rdar://problem/12811887>
1989 Reviewed by Darin Adler.
1991 We essentially move computeHash() to a member function of StringHasher. This allows clients of the
1992 hasher to append strings to the general hash, without having to first concatenate the strings.
1994 * wtf/StringHasher.h:
1995 (WTF::StringHasher::addCharacters): Same as computeHash(), except also take into account the possibility
1996 that there is a pending character to hash. If this is the case, we align the word boundary by consuming the
1997 first character in data, adjust the length, move the data pointer forward one, and update the hasher's
1998 pending character state. Also add an early return so that we are guaranteed at least one character in case
1999 we run into this situation.
2000 (WTF::StringHasher::computeHash): Refactor into addCharacters().
2002 2012-12-04 Yury Semikhatsky <yurys@chromium.org>
2004 Web Inspector: simplify reportMemoryUsage signature
2005 https://bugs.webkit.org/show_bug.cgi?id=104028
2007 Reviewed by Vsevolod Vlasov.
2009 Removed const& modifier from instrumented pointer type. Was const T* const&,
2012 * wtf/MemoryInstrumentation.cpp:
2013 (WTF::MemoryClassInfo::addRawBuffer):
2014 * wtf/MemoryInstrumentation.h:
2015 (MemoryInstrumentation):
2016 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
2017 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
2019 (WTF::reportMemoryUsage):
2020 (WTF::MemoryInstrumentation::addObjectImpl):
2022 * wtf/MemoryInstrumentationArrayBufferView.h:
2023 (WTF::reportMemoryUsage):
2024 * wtf/MemoryInstrumentationHashCountedSet.h:
2025 (WTF::reportMemoryUsage):
2026 * wtf/MemoryInstrumentationHashMap.h:
2027 (WTF::reportMemoryUsage):
2028 * wtf/MemoryInstrumentationHashSet.h:
2029 (WTF::reportMemoryUsage):
2030 * wtf/MemoryInstrumentationListHashSet.h:
2031 (WTF::reportMemoryUsage):
2032 * wtf/MemoryInstrumentationParsedURL.h:
2033 (WTF::reportMemoryUsage):
2034 * wtf/MemoryInstrumentationString.h:
2035 (WTF::reportMemoryUsage):
2036 * wtf/MemoryInstrumentationVector.h:
2037 (WTF::reportMemoryUsage):
2039 2012-12-01 Filip Pizlo <fpizlo@apple.com>
2041 JSC should be able to report profiling data associated with the IR dumps and disassembly
2042 https://bugs.webkit.org/show_bug.cgi?id=102999
2044 Reviewed by Gavin Barraclough.
2046 Made some minor changes to support the new profiler. FileOutputStream now has an
2047 open() method, and DataLog uses it. StringPrintStream has a reset() method, which
2048 allows you to reuse the same StringPrintStream for creating multiple strings.
2049 SegmentedVector now has a const operator[]. And, WTFString now can do fromUTF8() on
2053 (WTF::initializeLogFileOnce):
2054 * wtf/FilePrintStream.cpp:
2055 (WTF::FilePrintStream::open):
2057 * wtf/FilePrintStream.h:
2058 * wtf/SegmentedVector.h:
2059 (WTF::SegmentedVector::at):
2061 (WTF::SegmentedVector::operator[]):
2062 * wtf/StringPrintStream.cpp:
2063 (WTF::StringPrintStream::reset):
2065 * wtf/StringPrintStream.h:
2066 (StringPrintStream):
2067 * wtf/text/WTFString.cpp:
2068 (WTF::String::fromUTF8):
2070 * wtf/text/WTFString.h:
2073 2012-12-04 Sheriff Bot <webkit.review.bot@gmail.com>
2075 Unreviewed, rolling out r136597.
2076 http://trac.webkit.org/changeset/136597
2077 https://bugs.webkit.org/show_bug.cgi?id=104065
2079 broke Windows compilation (Requested by yurys on #webkit).
2081 * wtf/MemoryInstrumentation.cpp:
2082 (WTF::MemoryClassInfo::addRawBuffer):
2083 * wtf/MemoryInstrumentation.h:
2084 (MemoryInstrumentation):
2085 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
2086 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
2088 (WTF::reportMemoryUsage):
2089 (WTF::MemoryInstrumentation::addObjectImpl):
2091 * wtf/MemoryInstrumentationArrayBufferView.h:
2092 (WTF::reportMemoryUsage):
2093 * wtf/MemoryInstrumentationHashCountedSet.h:
2094 (WTF::reportMemoryUsage):
2095 * wtf/MemoryInstrumentationHashMap.h:
2096 (WTF::reportMemoryUsage):
2097 * wtf/MemoryInstrumentationHashSet.h:
2098 (WTF::reportMemoryUsage):
2099 * wtf/MemoryInstrumentationListHashSet.h:
2100 (WTF::reportMemoryUsage):
2101 * wtf/MemoryInstrumentationParsedURL.h:
2102 (WTF::reportMemoryUsage):
2103 * wtf/MemoryInstrumentationString.h:
2104 (WTF::reportMemoryUsage):
2105 * wtf/MemoryInstrumentationVector.h:
2106 (WTF::reportMemoryUsage):
2108 2012-12-04 Yury Semikhatsky <yurys@chromium.org>
2110 Web Inspector: simplify reportMemoryUsage signature
2111 https://bugs.webkit.org/show_bug.cgi?id=104028
2113 Reviewed by Vsevolod Vlasov.
2115 Removed const& modifier from instrumented pointer type. Was const T* const&,
2118 * wtf/MemoryInstrumentation.cpp:
2119 (WTF::MemoryClassInfo::addRawBuffer):
2120 * wtf/MemoryInstrumentation.h:
2121 (MemoryInstrumentation):
2122 (WTF::MemoryInstrumentation::selectInstrumentationMethod):
2123 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
2125 (WTF::reportMemoryUsage):
2126 (WTF::MemoryInstrumentation::addObjectImpl):
2128 * wtf/MemoryInstrumentationArrayBufferView.h:
2129 (WTF::reportMemoryUsage):
2130 * wtf/MemoryInstrumentationHashCountedSet.h:
2131 (WTF::reportMemoryUsage):
2132 * wtf/MemoryInstrumentationHashMap.h:
2133 (WTF::reportMemoryUsage):
2134 * wtf/MemoryInstrumentationHashSet.h:
2135 (WTF::reportMemoryUsage):
2136 * wtf/MemoryInstrumentationListHashSet.h:
2137 (WTF::reportMemoryUsage):
2138 * wtf/MemoryInstrumentationParsedURL.h:
2139 (WTF::reportMemoryUsage):
2140 * wtf/MemoryInstrumentationString.h:
2141 (WTF::reportMemoryUsage):
2142 * wtf/MemoryInstrumentationVector.h:
2143 (WTF::reportMemoryUsage):
2145 2012-12-03 Yury Semikhatsky <yurys@chromium.org>
2147 Web Inspector: NMI introduce heap graph recording API
2148 https://bugs.webkit.org/show_bug.cgi?id=103232
2150 Reviewed by Vsevolod Vlasov.
2152 MemoryInstrumentationClient is extended with several methods for reporting
2153 heap graph vertices and edges. Edge source is always idenfied by heap object
2154 address. Target node might be either a destination object address(either real
2155 or adjusted if the edge was retrieved from a pointer to a base class) or a
2156 MemoryObjectInfo in case of internal buffers.
2158 * wtf/MemoryInstrumentation.cpp:
2159 (WTF::MemoryInstrumentation::reportEdge):
2161 (WTF::MemoryInstrumentation::reportLinkToBuffer): report edge between the object
2162 and a buffer which it owns.
2163 (WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
2164 (WTF::MemoryClassInfo::addRawBuffer):
2165 (WTF::MemoryClassInfo::addPrivateBuffer):
2166 * wtf/MemoryInstrumentation.h:
2167 (MemoryInstrumentationClient):
2168 (WTF::MemoryInstrumentationClient::reportNode):
2169 (WTF::MemoryInstrumentationClient::reportEdge):
2170 (WTF::MemoryInstrumentationClient::reportLeaf):
2171 (WTF::MemoryInstrumentationClient::reportBaseAddress): if we found an object by a pointer
2172 to base class it may have different value than real object address. Report both real and
2173 adjusted addresses so that they both can be used for identifying corresponding heap graph
2175 (WTF::MemoryInstrumentation::addRootObject):
2176 (MemoryInstrumentation):
2177 (WTF::MemoryInstrumentation::addObject):
2178 (WTF::MemoryInstrumentation::addRawBuffer):
2179 (WTF::MemoryInstrumentation::OwningTraits::addObject):
2180 (WTF::MemoryClassInfo::addMember):
2182 (WTF::MemoryInstrumentation::addObjectImpl):
2183 * wtf/MemoryObjectInfo.h: added methods for repoting class name and some name string.
2184 (WTF::MemoryObjectInfo::setClassName):
2185 (WTF::MemoryObjectInfo::setName):
2188 2012-12-03 Filip Pizlo <fpizlo@apple.com>
2190 Replace JSValue::description() with JSValue::dump(PrintStream&)
2191 https://bugs.webkit.org/show_bug.cgi?id=103866
2193 Reviewed by Darin Adler.
2195 Make it easier to get a String from a StringPrintStream.
2197 * wtf/StringPrintStream.cpp:
2198 (WTF::StringPrintStream::toString):
2199 * wtf/StringPrintStream.h:
2200 (StringPrintStream):
2203 2012-12-02 Filip Pizlo <fpizlo@apple.com>
2205 It should be possible to build and run with DFG_ENABLE(PROPAGATION_VERBOSE)
2206 https://bugs.webkit.org/show_bug.cgi?id=103848
2208 Reviewed by Sam Weinig.
2210 Increase the variadicity of dataLog() and print(), and add a pointerDump()
2211 which allows passing a pointer to something that has a printInternal(). If
2212 the pointer is null, it'll print "(null)"; otherwise it'll invoke the
2213 printInternal() function.
2218 * wtf/PrintStream.h:
2220 (WTF::PrintStream::print):
2223 (WTF::PointerDump::PointerDump):
2224 (WTF::PointerDump::dump):
2227 2012-11-30 Simon Hausmann <simon.hausmann@digia.com>, Pierre Rossi <pierre.rossi@digia.com>
2229 [Qt] Separate Qt WebKit into Qt WebKit and Qt WebKit Widgets
2230 https://bugs.webkit.org/show_bug.cgi?id=99314
2232 Reviewed by Tor Arne Vestbø.
2234 This big change separates QtWebKit into QtWebKit and QtWebKitWidgets as
2237 It's a big refactoring that mostly involves moving WebCore dependent
2238 code into QtWebKit and accessing it through exported QWebFrameAdapter
2239 and QWebPageAdapter classes.
2242 * wtf/text/WTFString.h:
2243 (String): Export the QString conversions also as WTF_STRING_API.
2245 2012-11-29 Filip Pizlo <fpizlo@apple.com>
2247 It should be easy to find code blocks in debug dumps
2248 https://bugs.webkit.org/show_bug.cgi?id=103623
2250 Reviewed by Geoffrey Garen.
2252 Changed RawPointer to accept both const void* and void*, and use the former internally.
2254 Cleaned up SHA1 so that the functionality already used internally for self-testing is
2255 available via the API. This includes addBytes(CString) and computing hex digests.
2258 (WTF::RawPointer::RawPointer):
2260 (WTF::RawPointer::value):
2263 (WTF::SHA1::hexDigest):
2264 (WTF::SHA1::computeHexDigest):
2266 (WTF::SHA1::addBytes):
2268 2012-11-29 Patrick Gansterer <paroga@webkit.org>
2270 Build fix for WinCE after r136096.
2272 * wtf/StringPrintStream.cpp: Added missing include file.
2274 2012-11-28 Filip Pizlo <fpizlo@apple.com>
2276 SpeculatedType dumping should not use the static char buffer[thingy] idiom
2277 https://bugs.webkit.org/show_bug.cgi?id=103584
2279 Reviewed by Michael Saboff.
2281 Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives.
2283 * GNUmakefile.list.am:
2286 * WTF.vcproj/WTF.vcproj:
2287 * WTF.xcodeproj/project.pbxproj:
2288 * wtf/CMakeLists.txt:
2289 * wtf/PrintStream.cpp:
2290 (WTF::dumpCharacter):
2291 * wtf/PrintStream.h:
2292 (WTF::printInternal):
2293 * wtf/StringPrintStream.cpp: Added.
2294 (WTF::StringPrintStream::StringPrintStream):
2295 (WTF::StringPrintStream::~StringPrintStream):
2296 (WTF::StringPrintStream::vprintf):
2297 (WTF::StringPrintStream::toCString):
2298 (WTF::StringPrintStream::increaseSize):
2299 * wtf/StringPrintStream.h: Added.
2300 (StringPrintStream):
2303 2012-11-28 Michael Saboff <msaboff@apple.com>
2305 Update String Stats for recent dataLog changes and add summary
2306 https://bugs.webkit.org/show_bug.cgi?id=103583
2308 Reviewed by Filip Pizlo.
2310 Updated calls to dataLog() to dataLogF() as a results of r135469.
2311 Added total savings from 8 bit strings in bytes and as a percentage.
2313 * wtf/text/StringImpl.cpp:
2314 (WTF::StringStats::printStats):
2316 2012-11-28 Roger Fong <roger_fong@apple.com>
2318 Make DataLog work/compile properly on Windows.
2319 https://bugs.webkit.org/show_bug.cgi?id=103544
2321 Reviewed by Filip Pizlo.
2324 (WTF::initializeLogFileOnce):
2326 2012-11-28 Filip Pizlo <fpizlo@apple.com>
2328 It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count)
2329 https://bugs.webkit.org/show_bug.cgi?id=103009
2331 Reviewed by Michael Saboff.
2333 Added the ability to use out.print(...) and dataLog(...) variadically and with
2334 WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want
2335 to be able to pass as an argument to out.print() or dataLog(). Also added one
2336 example class for doing this: RawPointer, which can be used to force a pointer
2337 to be printed as "%p" rather than matching any overloads that you might want to
2340 * GNUmakefile.list.am:
2343 * WTF.vcproj/WTF.vcproj:
2344 * WTF.xcodeproj/project.pbxproj:
2345 * wtf/CMakeLists.txt:
2349 * wtf/PrintStream.cpp:
2350 (WTF::printInternal):
2352 * wtf/PrintStream.h:
2354 (WTF::PrintStream::print):
2356 * wtf/RawPointer.h: Added.
2359 (WTF::RawPointer::RawPointer):
2360 (WTF::RawPointer::value):
2362 2012-11-27 Filip Pizlo <fpizlo@apple.com>
2364 Convert some remaining uses of FILE* to PrintStream&.
2366 Rubber stamped by Mark Hahnenberg.
2368 * wtf/BitVector.cpp:
2369 (WTF::BitVector::dump):
2373 2012-11-27 Pratik Solanki <psolanki@apple.com>
2375 objc/objc-runtime.h does not exist on all PLATFORM(MAC)
2376 https://bugs.webkit.org/show_bug.cgi?id=101780
2378 Reviewed by Brent Fulgham.
2380 Clean up header includes so we don't include objc/objc-runtime.h.
2383 * wtf/ObjcRuntimeExtras.h: Include objc/message.h here so we don't rely on proper ordering
2384 of includes in files that include this header.
2386 2012-11-27 Sheriff Bot <webkit.review.bot@gmail.com>
2388 Unreviewed, rolling out r135828.
2389 http://trac.webkit.org/changeset/135828
2390 https://bugs.webkit.org/show_bug.cgi?id=103405
2392 [Chromium] Multiple ASAN errors after a WebKit roll due to
2393 mismatched malloc/delete (not free) resulting from
2394 StringImpl::deref() (Requested by apavlov on #webkit).
2396 * wtf/FastAllocBase.h:
2399 2012-11-26 Adam Barth <abarth@webkit.org>
2401 [Chromium] fastMalloc has an extra branch on Windows
2402 https://bugs.webkit.org/show_bug.cgi?id=103027
2404 Reviewed by Eric Seidel.
2406 There's no need to override the new/delete operators on non-Mac
2409 1) We use the system malloc anyway.
2410 2) We've modified the system malloc to crash in out-of-memory conditions.
2412 This patch removes a branch (and a call) from malloc, which will
2413 hopefully improve performance. I haven't measured the performance
2414 characteristics of this patch, but I will look at the graphs closely
2417 * wtf/FastAllocBase.h:
2420 2012-11-26 Filip Pizlo <fpizlo@apple.com>
2422 DataLog to a file should work if there are multiple processes using WTF
2423 https://bugs.webkit.org/show_bug.cgi?id=103323
2425 Reviewed by Mark Hahnenberg.
2427 Whereas before DataLog would open a file with the name you specified, now it'll open a file with the
2428 name plus the PID appended to it. So if you are dealing with multiple processes running with DataLog
2429 to a file enabled, you'll get multiple separate log files.
2432 (WTF::initializeLogFileOnce):
2434 2012-11-26 Zeno Albisser <zeno@webkit.org>
2436 [Qt] Fix the LLInt build on Mac
2437 https://bugs.webkit.org/show_bug.cgi?id=97587
2439 Reviewed by Simon Hausmann.
2442 Use OS(DARWIN) instead of PLATFORM(MAC),
2443 in order to allow Qt to use the same code.
2446 2012-11-26 Patrick Gansterer <paroga@webkit.org>
2448 Build fix for WinCE after r135640.
2452 2012-11-24 Adam Barth <abarth@webkit.org>
2454 Chromium should use TCMalloc on Mac to go fast
2455 https://bugs.webkit.org/show_bug.cgi?id=102866
2457 Reviewed by Eric Seidel.
2459 This patch enables TCMalloc for some WebKit objects. It improves
2460 dom-modify on Mac by 5-10%.
2462 On non-Mac platforms, Chromium already uses TCMalloc throughout the
2463 project. Unfortunately, we haven't yet figured out how to turn TCMalloc
2464 on globally on Mac because the approach we use for other platforms makes
2467 The next best thing would be to enable TCMalloc for WebKit by
2468 overriding the global new and delete operator, as is done on apple-mac
2469 and other platforms. Unfortunately, we cannot use that approach either
2470 because the Chromium WebKit API is not memory tight.
2472 Fortunately, WebKit has a mechanism for selectively enabling TCMalloc
2473 for a selection of objects by overriding the new and delete operators
2474 on those objects. This patch opts chromium-mac into that scheme by
2475 setting the appropriate preprocessor macros.
2480 2012-11-21 Filip Pizlo <fpizlo@apple.com>
2482 Any function that can log things should be able to easily log them to a memory buffer as well
2483 https://bugs.webkit.org/show_bug.cgi?id=103000
2485 Reviewed by Sam Weinig.
2487 We have a number of places where we pass around a FILE* as a target to which to print
2488 some logging information. But the purpose of passing FILE* instead of always assuming
2489 that we should dump to stderr is that it may be sometimes useful to send the logging
2490 information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome
2491 to use it to send logging to a string, for example.
2493 We could get around this by using <iostream> and <sstream>, but so far this aspect of
2494 C++ has not been part of the WebKit coding conventions. Personally I find <iostream>
2495 awkward due to its abuse of operator overloading.
2497 So this patch introduces the PrintStream abstract class, which offers printf-like
2498 functionality while completely abstracting the destination and mechanism of the printing
2499 output. It would be trivial to implement a StringPrintStream, for example. This will feed
2500 into work on https://bugs.webkit.org/show_bug.cgi?id=102999.
2502 This also sets us up for creating templatized print() and println() methods that will
2503 allow us to say things like out.print("count = ", count, "\n"), but that is the topic
2504 of https://bugs.webkit.org/show_bug.cgi?id=103009.
2506 This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile()
2507 now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed
2508 to expect a PrintStream&.
2510 * GNUmakefile.list.am:
2512 * WTF.vcproj/WTF.vcproj:
2513 * WTF.xcodeproj/project.pbxproj:
2514 * wtf/CMakeLists.txt:
2517 (WTF::initializeLogFileOnce):
2518 (WTF::initializeLogFile):
2521 (WTF::dataLogString):
2524 * wtf/FilePrintStream.cpp: Added.
2526 (WTF::FilePrintStream::FilePrintStream):
2527 (WTF::FilePrintStream::~FilePrintStream):
2528 (WTF::FilePrintStream::vprintf):
2529 (WTF::FilePrintStream::flush):
2530 * wtf/FilePrintStream.h: Added.
2533 (WTF::FilePrintStream::file):
2534 * wtf/PrintStream.cpp: Added.
2536 (WTF::PrintStream::PrintStream):
2537 (WTF::PrintStream::~PrintStream):
2538 (WTF::PrintStream::printf):
2539 (WTF::PrintStream::print):
2540 (WTF::PrintStream::println):
2541 (WTF::PrintStream::flush):
2543 * wtf/PrintStream.h: Added.
2549 2012-11-23 Robert Kroeger <rjkroege@chromium.org>
2551 Remove unused ScrollByPixelVelocity
2552 https://bugs.webkit.org/show_bug.cgi?id=102840
2554 Reviewed by Sam Weinig.
2556 The GESTURE_ANIMATION feature turns on code in WebCore is unused.
2559 No new tests: code removal/cleanup.
2563 2012-11-23 Laszlo Gombos <l.gombos@samsung.com>
2565 [EFL] Define WTF_PLATFORM_EFL in Platform.h
2566 https://bugs.webkit.org/show_bug.cgi?id=101482
2568 Reviewed by Kenneth Rohde Christiansen.
2570 Define WTF_PLATFORM_EFL in Platform.h to be consistent with
2575 2012-11-16 Yury Semikhatsky <yurys@chromium.org>
2577 Memory instrumentation: extract MemoryObjectInfo declaration into a separate file
2578 https://bugs.webkit.org/show_bug.cgi?id=102510
2580 Reviewed by Pavel Feldman.
2582 Moved MemoryObjectInfo into separate header. Moved definition of MemoryInstrumentation
2583 methods that depend on MemoryObjectInfo declaration into MemoryInstrumentation.cpp to
2584 make MemoryInstrumentation require only forward declaration of MemoryObjectInfo.
2586 * GNUmakefile.list.am:
2589 * WTF.vcproj/WTF.vcproj:
2590 * wtf/CMakeLists.txt:
2591 * wtf/MemoryInstrumentation.cpp: Added.
2593 (WTF::MemoryInstrumentation::MemoryInstrumentation):
2594 (WTF::MemoryInstrumentation::~MemoryInstrumentation):
2595 (WTF::MemoryInstrumentation::getObjectType): this method allows to get object type without
2596 pulling in MemoryObjectInfo.h and all its dependencies.
2597 (WTF::MemoryInstrumentation::callReportObjectInfo):
2598 (WTF::MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase):
2599 (WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
2600 (WTF::MemoryClassInfo::init):
2601 (WTF::MemoryClassInfo::addRawBuffer):
2602 (WTF::MemoryClassInfo::addPrivateBuffer):
2603 * wtf/MemoryInstrumentation.h:
2604 (MemoryInstrumentation):
2605 (WTF::MemoryInstrumentation::addRootObject):
2606 (InstrumentedPointerBase):
2607 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
2608 (InstrumentedPointer):
2609 (WTF::MemoryInstrumentation::addObject): we now pass owner's MemoryObjectInfo in all places
2610 where we report objects pointed by the owner.
2611 (WTF::MemoryInstrumentation::OwningTraits::addObject):
2612 (WTF::MemoryClassInfo::MemoryClassInfo):
2613 (WTF::MemoryClassInfo::addMember):
2615 (WTF::MemoryInstrumentation::addObjectImpl):
2616 (WTF::::InstrumentedPointer):
2617 (WTF::::callReportMemoryUsage):
2618 * wtf/MemoryObjectInfo.h: Added.
2621 (WTF::MemoryObjectInfo::MemoryObjectInfo):
2622 (WTF::MemoryObjectInfo::objectType):
2623 (WTF::MemoryObjectInfo::objectSize):
2624 (WTF::MemoryObjectInfo::reportedPointer):
2625 (WTF::MemoryObjectInfo::memoryInstrumentation):
2626 (WTF::MemoryObjectInfo::reportObjectInfo):
2628 2012-11-23 Krzysztof Czech <k.czech@samsung.com>
2630 [EFL] Platform support for Accessibility feature.
2631 https://bugs.webkit.org/show_bug.cgi?id=100848
2633 Reviewed by Gyuyoung Kim.
2635 Enable HAVE(ACCESSIBILITY) ifdefs so that EFL port can use it.
2639 2012-11-22 Michael Saboff <msaboff@apple.com>
2641 HTML integer parsing functions don't natively handle 8 bit strings
2642 https://bugs.webkit.org/show_bug.cgi?id=102997
2644 Reviewed by Filip Pizlo.
2646 Added exports to the LChar* versions of charactersToIntStrict() and charactersToUIntStrict()
2647 to support the changes made to parseHTMLInteger() and parseHTMLNonNegativeInteger().
2649 * wtf/text/WTFString.h:
2650 (WTF::charactersToIntStrict): Added export
2651 (WTF::charactersToUIntStrict): Added export
2653 2012-11-21 Filip Pizlo <fpizlo@apple.com>
2655 Rename dataLog() and dataLogV() to dataLogF() and dataLogFV()
2656 https://bugs.webkit.org/show_bug.cgi?id=103001
2658 Rubber stamped by Dan Bernstein.
2663 (WTF::dataLogFString):
2666 * wtf/HashTable.cpp:
2667 (WTF::HashTableStats::dumpStats):
2669 (WTF::HashTable::Stats::dumpStats):
2670 * wtf/MetaAllocator.cpp:
2671 (WTF::MetaAllocator::dumpProfile):
2672 * wtf/StackStats.cpp:
2673 (WTF::StackStats::initialize):
2674 (WTF::StackStats::PerThreadStats::PerThreadStats):
2675 (WTF::StackStats::CheckPoint::CheckPoint):
2676 (WTF::StackStats::CheckPoint::~CheckPoint):
2677 (WTF::StackStats::probe):
2678 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
2679 * wtf/text/WTFString.cpp:
2682 2012-11-21 Anthony G. Basile <blueness@gentoo.org>
2684 Source/WTF/wtf/Assertions.cpp: fix build on a uClibc system
2685 https://bugs.webkit.org/show_bug.cgi?id=102946
2687 Reviewed by Tony Chang.
2689 Webkit-Gtk fails to build on a uClibc system because
2690 Assertions.cpp assumes that all Linux systems have execinfo.h
2691 and provide backtrace(). This is not necessarily the case for
2692 uClibc which can be configured without these. This patch
2693 refines the check for OS(LINUX) to prevent this breakage.
2694 Originally reported at https://bugs.gentoo.org/441674
2696 * wtf/Assertions.cpp:
2698 2012-11-19 Filip Pizlo <fpizlo@apple.com>
2700 DFG should be able to cache closure calls
2701 https://bugs.webkit.org/show_bug.cgi?id=102662
2703 Reviewed by Gavin Barraclough.
2705 Added support to the meta allocator for easily querying whether an address falls within
2706 a certain allocated chunk. Also added a useful debug routine to SentinelLinkedList,
2707 which can be used to check if a node is on a particular list.
2709 * wtf/MetaAllocatorHandle.h:
2710 (MetaAllocatorHandle):
2711 (WTF::MetaAllocatorHandle::containsIntegerAddress):
2712 (WTF::MetaAllocatorHandle::contains):
2713 * wtf/SentinelLinkedList.h:
2714 (SentinelLinkedList):
2718 2012-11-19 Laszlo Gombos <l.gombos@samsung.com>
2720 Remove ReadWriteLock
2721 https://bugs.webkit.org/show_bug.cgi?id=101637
2723 Reviewed by Darin Adler.
2725 Remove ReadWriteLock as it does not seems to be used.
2727 * wtf/Platform.h: Remove the definition of HAVE_PTHREAD_RWLOCK.
2729 * wtf/ThreadingPrimitives.h: Remove the PlatformReadWriteLock type
2730 and the ReadWriteLock class.
2732 * wtf/ThreadingPthreads.cpp: Remove the implementation of
2733 the ReadWriteLock class using pthreads.
2735 2012-11-19 Brady Eidson <beidson@apple.com>
2737 Add 64-bit specializations for atomicIncrement and atomicDecrement
2738 https://bugs.webkit.org/show_bug.cgi?id=102702
2740 Reviewed by Eric Carlson.
2743 (WTF::atomicIncrement): Add A 64-bit version for Darwin.
2744 (WTF::atomicDecrement): Ditto.
2746 2012-11-18 Laszlo Gombos <l.gombos@samsung.com>
2748 Remove non-existent directories from the make system
2749 https://bugs.webkit.org/show_bug.cgi?id=102632
2751 Reviewed by Adam Barth.
2753 Remove (non-existent) symbian references from the exclude list in gyp project files.
2757 2012-11-16 Michael Saboff <msaboff@apple.com>
2759 String::fromUTF8() should take advantage of the ASCII check in convertUTF8ToUTF16()
2760 https://bugs.webkit.org/show_bug.cgi?id=100577
2762 Reviewed by Oliver Hunt.
2764 Passed in ASCII flag to convertUTF8ToUTF16() and if try, create an 8 bit string from the original arguments.
2765 Relanding after fix to https://bugs.webkit.org/show_bug.cgi?id=102482.
2767 * wtf/text/WTFString.cpp:
2768 (WTF::String::fromUTF8):
2770 2012-11-15 Yury Semikhatsky <yurys@chromium.org>
2772 Memory instrumentation: add code for reporting stack traces of unknown instrumented objects
2773 https://bugs.webkit.org/show_bug.cgi?id=102384
2775 Reviewed by Pavel Feldman.
2777 Added an option to collect stack traces for instrumented pointers so that they
2778 can be printed in case the check failed for the pointer. This code is hidden
2781 * wtf/MemoryInstrumentation.h:
2782 (MemoryInstrumentationClient):
2783 (WTF::MemoryInstrumentation::checkCountedObject): the method now returns false
2784 in case the check has failed.
2785 (InstrumentedPointer):
2786 (WTF::::InstrumentedPointer):
2790 2012-11-15 Mark Hahnenberg <mhahnenberg@apple.com>
2792 Windows Fibers can corrupt the cached StackBounds
2793 https://bugs.webkit.org/show_bug.cgi?id=102411
2795 Reviewed by Geoffrey Garen.
2797 Windows has support for something called fibers, which are like lightweight versions of
2798 threads. Multiple fibers can run within the context of a single thread and they have access
2799 to the same thread local storage but have different stacks. If we create a new JSGlobalContext
2800 on one fiber, then switch to another fiber and create a JSGlobalContext there, we will call
2801 initializeThreading() once for each new JSGlobalContext created. However, since these fibers
2802 are technically running inside the same thread, they will clobber each other's wtfThreadData(),
2803 which is stored using thread local storage. This can lead to corruption of the WTFThreadData
2804 structure for the fibers other than the last one to create a new JSGlobalContext, including
2805 the StackBounds data structure which is used during conservative scanning, among other things.
2806 This can lead to crashes during garbage collection on Windows if fibers are used.
2808 A quick fix would be to always get a fresh StackBounds data structure when asking for it
2809 instead of using the cached version from the thread local storage. There is a larger problem
2810 in that these fibers can corrupt other WebKit data that uses thread local storage. We'll leave
2811 those theoretical fixes for future theoretical bugs.
2813 * wtf/WTFThreadData.h:
2814 (WTF::WTFThreadData::stack): We now refresh the m_stackBounds field whenever somebody asks for
2817 2012-11-15 Maciej Stachowiak <mjs@apple.com>
2819 Fix an erroneous comment about the operators required by binarySearch
2820 https://bugs.webkit.org/show_bug.cgi?id=102406
2822 Reviewed by Anders Carlsson.
2824 * wtf/StdLibExtras.h: binarySearch needs '==' and '<', not '--', '<' and '>'.
2826 2012-11-14 Michael Saboff <msaboff@apple.com>
2828 String::append() should handle two 8 bit strings without converting both to 16 bits
2829 https://bugs.webkit.org/show_bug.cgi?id=102286
2831 Reviewed by Oliver Hunt.
2833 If both strings are 8 bit, then allocate and copy to a new 8 bit string. Since most strings are
2834 8 bit, this will save up to 3x the resulting string length in bytes. 2x is due to the possible
2835 surviving 16 bit source string upconversion and 1x for the 16 bit result now being 8 bit.
2837 * wtf/text/WTFString.cpp:
2838 (WTF::String::append):
2840 2012-11-14 Csaba Osztrogonác <ossy@webkit.org>
2842 [Qt][ARM] Enable the DFG JIT on ARMv7(Thumb2)
2843 https://bugs.webkit.org/show_bug.cgi?id=101747
2845 Reviewed by Simon Hausmann.
2849 2012-11-13 Christophe Dumez <christophe.dumez@intel.com>
2851 Use prefix form of increment / decrement operators in WTF String classes when possible
2852 https://bugs.webkit.org/show_bug.cgi?id=101859
2854 Reviewed by Benjamin Poulain.
2856 Use prefix form of increment / decrement operators whenever possible in
2857 WTF String classes as this seems to be the convention in WebKit.
2859 * wtf/text/ASCIIFastPath.h:
2860 (WTF::copyLCharsFromUCharSource):
2861 * wtf/text/AtomicString.cpp:
2862 (WTF::AtomicString::add):
2863 * wtf/text/Base64.cpp:
2864 (WTF::base64Encode):
2865 (WTF::base64DecodeInternal):
2866 * wtf/text/StringBuilder.cpp:
2867 (WTF::StringBuilder::allocateBufferUpConvert):
2868 * wtf/text/StringConcatenate.h:
2869 * wtf/text/StringImpl.cpp:
2870 (WTF::StringImpl::getData16SlowCase):
2871 (WTF::StringImpl::upconvertCharacters):
2872 (WTF::StringImpl::containsOnlyWhitespace):
2873 (WTF::StringImpl::lower):
2874 (WTF::StringImpl::upper):
2875 (WTF::StringImpl::foldCase):
2876 (WTF::StringImpl::stripMatchedCharacters):
2877 (WTF::StringImpl::removeCharacters):
2878 (WTF::StringImpl::simplifyMatchedCharactersToSpace):
2879 (WTF::reverseFindInner):
2880 (WTF::reverseFindIgnoringCaseInner):
2881 (WTF::StringImpl::replace):
2882 (WTF::StringImpl::createWithTerminatingNullCharacter):
2883 * wtf/text/StringImpl.h:
2884 (WTF::codePointCompare):
2885 * wtf/text/WTFString.cpp:
2886 (WTF::String::String):
2887 (WTF::toIntegralType):
2889 2012-11-13 Ryosuke Niwa <rniwa@webkit.org>
2891 Build fix after r134490.
2893 * wtf/FastMalloc.cpp:
2895 2012-11-13 Brent Fulgham <bfulgham@webkit.org> and Alex Christensen <alex.christensen@flexsim.com>
2897 Fix FastMalloc.cpp compile error for MSVC in 64-bit.
2898 https://bugs.webkit.org/show_bug.cgi?id=88344
2900 Reviewed by Ryosuke Niwa.
2902 MSVC will not compile array declarations of zero size. The existing
2903 padding math for TCMalloc_Central_FreeListPadded would evaluate
2904 to zero on 64-bit machines, preventing the compile from finishing.
2906 * wtf/FastMalloc.cpp:
2907 (TCMalloc_Central_FreeListPadded_Template): Add new template (and
2908 zero-size specialization) to provide proper behavior under 64-bit
2911 2012-11-13 Brent Fulgham <bfulgham@webkit.org> and Alex Christensen <alex.christensen@flexsim.com>
2913 FastMalloc.cpp needs to be reordered before padding bug can be fixed
2914 https://bugs.webkit.org/show_bug.cgi?id=89366
2916 Note: This file violates Style rules. This change only moves
2917 the TCMalloc_Central_FreeList class declaration and the various
2918 FastMallocZone methods earlier in the file.
2920 Reviewed by Ryosuke Niwa.
2922 * wtf/FastMalloc.cpp:
2923 Reordered definitions to prepare for adding specialized template
2925 (TCMalloc_Central_FreeList):
2926 (WTF::TCMalloc_Central_FreeList::length):
2927 (WTF::TCMalloc_Central_FreeList::tc_length):
2928 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects):
2929 (TCMalloc_Central_FreeListPadded):
2931 (WTF::FastMallocZone::goodSize):
2932 (WTF::FastMallocZone::check):
2933 (WTF::FastMallocZone::print):
2934 (WTF::FastMallocZone::log):
2935 (WTF::FastMallocZone::forceLock):
2936 (WTF::FastMallocZone::forceUnlock):
2937 (WTF::FastMallocZone::statistics):
2938 (WTF::FastMallocZone::zoneValloc):
2939 (WTF::FastMallocZone::zoneDestroy):
2940 (WTF::KernelSupportsTLS):
2941 (WTF::CheckIfKernelSupportsTLS):
2942 (TCMalloc_ThreadCache):
2944 2012-11-11 Kenichi Ishibashi <bashi@chromium.org>
2946 WTFString::utf8() should have a mode of conversion to use replacement character
2947 https://bugs.webkit.org/show_bug.cgi?id=101678
2949 Reviewed by Alexander Pavlov.
2951 Introduce conversion mode to String::utf8().
2952 There are three conversion modes; lenient mode, strict mode, and
2953 "replacing unpaired surrogates with the replacement character" (replacement) mode.
2954 Lenient mode converts unpaired surrogates. Strict mode fails when there is an unpaired
2955 surrogates and returns CString(). Replacement mode replaces unpaired surrogates with
2956 the replacement character(U+FFFD). Replacement mode implements the algorithm defined at
2957 http://dev.w3.org/2006/webapi/WebIDL/#dfn-obtain-unicode. WebSocket::send() requires
2958 this algorithm to encode a string to utf-8.
2960 * wtf/text/WTFString.cpp:
2961 (WTF::String::utf8): Changed to take ConversionMode as the argument.
2962 * wtf/text/WTFString.h:
2965 2012-11-09 Alexei Filippov <alph@chromium.org>
2967 Web Inspector: Fix heap snapshots counted several times by NMI
2968 https://bugs.webkit.org/show_bug.cgi?id=101085
2970 The fix moves snapshots size counting to V8PerIsolateData class. As long
2971 as it has one instance per isolate its reportMemoryUsage should be
2972 called once per isolate.
2974 Reviewed by Yury Semikhatsky.
2976 * wtf/MemoryInstrumentation.h:
2977 (WTF::MemoryClassInfo::addPrivateBuffer):
2979 2012-11-08 Michael Saboff <msaboff@apple.com>
2981 HashAndUTF8CharactersTranslator should create an 8 bit string if possible
2982 https://bugs.webkit.org/show_bug.cgi?id=101515
2984 Reviewed by Darin Adler.
2986 Added isAllASCII flag that's passed to convertUTF8ToUTF16(). If on return it is true, create an
2987 8 bit string, otherwise use the 16 bit string.
2989 * wtf/text/AtomicString.cpp:
2990 (WTF::HashAndUTF8CharactersTranslator::translate):
2992 2012-11-08 Simon Hausmann <simon.hausmann@digia.com>
2994 [Qt] Fix build with MSVC 2012 and Angle
2995 https://bugs.webkit.org/show_bug.cgi?id=101588
2997 Reviewed by Tor Arne Vestbø.
2999 Angle includes STL's <memory> header file, which with MSVC 2012 includes stdint.h. MSVC 2012
3000 does ship stdint.h, but it's lacking other headers such as inttypes.h.
3002 So for the rest of WebKit we have to continue to use our own versions of these files from
3003 JavaScriptCore/os-win32. But for Angle we are just including a shipped STL header file (memory)
3004 and so it's up to the compiler to make that work, i.e. using the stdint.h it ships.
3006 This patch moves the addition of JavaScriptCore/os-win32 out of default_post.prf, so that it
3007 doesn't apply to each and every target anymore. In particular it won't apply to Angle anymore,
3008 because its presence causes a build issue where due to the addition of os-win32/ we end up
3009 including our own stdint.h but are lacking WTF/ to be in the include search path (which our own
3010 stdint.h requires). So out of default_post.prf and into WTF.pri, our own wrappers are now only
3011 used where WTF is also needed, and since os-win32/stdint.h depends on wtf/Platform.h, it seems
3012 like a logical location.
3016 2012-11-07 Hans Wennborg <hans@chromium.org>
3018 Fix asm operand type for weakCompareAndSwap on ARM_THUMB2
3019 https://bugs.webkit.org/show_bug.cgi?id=101238
3021 Reviewed by Benjamin Poulain.
3023 'result' was a bool, but the asm was expecting a 32-bit register. A
3024 recent version of Clang warned about this:
3026 WebKit/Source/WTF/wtf/Atomics.h:163:34: error: the size being stored
3027 is truncated, use a modifier to specify the size [-Werror,-Wasm-operand-widths]
3029 This patch fixes it by making 'result' an unsigned. It does not change
3030 the functionality in practice ('result' would be in a 32-bit register
3031 anyway), but it makes the code more correct and makes the warning go
3034 Also make 'result' for the X86 version an 'unsigned char' to make it
3035 more clear that it is a byte.
3038 (WTF::weakCompareAndSwap):
3040 2012-11-07 Remy Demarest <rdemarest@apple.com>
3042 Function adoptNS and adoptCF should not generate memory leak diagnostic with Clang Static Analyzer.
3043 https://bugs.webkit.org/show_bug.cgi?id=101420
3045 Reviewed by Benjamin Poulain.
3047 Add attributes to the adoptNS and adoptCF function arguments to remove Clang Static Analyzer diagnotics.
3048 Define CF_RELEASES_ARGUMENT and NS_RELEASES_ARGUMENT if not available, use them in function declarations.
3051 (WTF::adoptCF): Adds CF_RELEASES_ARGUMENT attribute to the argument.
3052 (WTF::adoptNS): Adds NS_RELEASES_ARGUMENT attribute to the argument.
3054 2012-11-07 Christophe Dumez <christophe.dumez@intel.com>
3056 Add replaceWithLiteral() method to WTF::String
3057 https://bugs.webkit.org/show_bug.cgi?id=101257
3059 Reviewed by Benjamin Poulain.
3061 Add replaceWithLiteral() method to WTF::String that takes
3062 replacement string as a literal to avoid uselessly constructing
3065 * wtf/text/StringImpl.cpp:
3066 (WTF::StringImpl::replace):
3068 * wtf/text/StringImpl.h:
3069 (WTF::StringImpl::replace):
3071 * wtf/text/WTFString.h:
3073 (WTF::String::replaceWithLiteral):
3075 2012-11-06 Michael Saboff <msaboff@apple.com>
3077 StringBuilder::append(UChar) with an 8 bit quantity shouldn't change the contents to 16 bits
3078 https://bugs.webkit.org/show_bug.cgi?id=101421
3080 Reviewed by Anders Carlsson.
3082 If the string builder contains only 8 bit data, check if the character being appended contains
3083 8 bit data. If so, append it to the 8 bit buffer instead of converting the buffer to 16 bits.
3085 * wtf/text/StringBuilder.cpp:
3086 (WTF::StringBuilder::append):
3087 * wtf/text/StringBuilder.h:
3088 (WTF::StringBuilder::append):
3090 2012-11-06 Benjamin Poulain <benjamin@webkit.org>
3092 Speed up TransformationMatrix::multiply() on modern ARM
3093 https://bugs.webkit.org/show_bug.cgi?id=101084
3095 Reviewed by Gavin Barraclough.
3098 Add CPU(ARM_VFP) for detecting VFP availability.
3099 Add CPU(APPLE_ARMV7S) for the Apple ARMv7S architecture.
3101 2012-11-06 Laszlo Gombos <l.gombos@samsung.com>
3103 Refactor setting TEXTURE_MAPPER_GL
3104 https://bugs.webkit.org/show_bug.cgi?id=99758
3106 Reviewed by Noam Rosenthal.
3108 Make the rule that sets the default for USE(3D_GRAPHICS) port independent.
3110 If not set, set USE(TEXTURE_MAPPER_GL) when USE(TEXTURE_MAPPER) and
3111 USE(3D_GRAPHICS) is enabled.
3115 2012-11-05 Philip Rogers <pdr@google.com>
3117 Unblock SVG external references
3118 https://bugs.webkit.org/show_bug.cgi?id=100635
3120 Reviewed by Adam Barth.
3122 This patch reverts r132849 and r132869 because the potential XSS issue
3123 turned out to not be an issue after all.
3125 Covered by existing tests, many of which are re-whitelisted with this patch.
3129 2012-11-05 Dima Gorbik <dgorbik@apple.com>
3131 Back out controversial changes from Bug 98665.
3132 https://bugs.webkit.org/show_bug.cgi?id=101244
3134 Reviewed by David Kilzer.
3136 Backing out changes from Bug 98665 until further discussions take place on rules for including Platform.h in Assertions.h.
3140 2012-11-03 Alexey Proskuryakov <ap@apple.com>
3142 Get rid of USE(CFURLSTORAGESESSIONS)
3143 https://bugs.webkit.org/show_bug.cgi?id=101131
3145 Reviewed by Sam Weinig.
3149 2012-11-02 Ilya Tikhonovsky <loislo@chromium.org>
3151 Web Inspector: NMI instrument NodeRareData::Map. It uses ~250k on nytimes.com
3152 https://bugs.webkit.org/show_bug.cgi?id=101052
3154 Reviewed by Yury Semikhatsky.
3156 I noticed that in many cases cache structures are plain static HashMap, HashSet etc.
3157 MemoryAgent can visit it but instrumentation for these containers report no objectType.
3158 It means that addRootObject method needs to accept objectType property as an argument.
3159 Otherwise I would have had to create a proxy class with proper objectType.
3161 * wtf/MemoryInstrumentation.h:
3162 (WTF::MemoryInstrumentation::addRootObject):
3164 2012-11-01 Kent Tamura <tkent@chromium.org>
3166 Introduce ENABLE_DATE_AND_TIME_INPUT_TYPES, and clarify usage of other related flags
3167 https://bugs.webkit.org/show_bug.cgi?id=101007
3169 Reviewed by Kentaro Hara.
3172 Add ENABLE_DATE_AND_TIME_INPUT_TYPES. It's a union of
3173 ENABLE_INPUT_TYPE_{DATE,DATETIME,DATETIMELOCAL,MONTH,TIME,WEEK}.
3175 2012-11-01 Yury Semikhatsky <yurys@chromium.org>
3177 Memory instrumentation: do not call checkCountedObject with wrong pointers
3178 https://bugs.webkit.org/show_bug.cgi?id=100958
3180 Reviewed by Alexander Pavlov.
3182 Removed calls to checkCountedObject from places where the pointer may contain
3183 an address of a base class which may differ from the actual object pointer. Instead
3184 checkCountedObject is only called right after processing deferred pointer where
3185 we know real address.
3187 * wtf/MemoryInstrumentation.h:
3188 (WTF::MemoryInstrumentation::addObjectImpl):
3191 2012-11-01 Alexey Proskuryakov <ap@apple.com>
3193 Rename HAVE(NETWORK_CFDATA_ARRAY_CALLBACK) to USE(NETWORK_CFDATA_ARRAY_CALLBACK)
3195 Rubber-stamped by Joe Pecoraro.
3197 All CFNetwork based platforms have this now, but not all use it at the moment.
3199 2012-11-01 Alexey Proskuryakov <ap@apple.com>
3201 Fix HAVE(NETWORK_CFDATA_ARRAY_CALLBACK) build
3202 https://bugs.webkit.org/show_bug.cgi?id=100979
3204 Reviewed by Joseph Pecoraro.
3206 * wtf/Platform.h: Added a FIXME about HAVE(NETWORK_CFDATA_ARRAY_CALLBACK).
3208 2012-11-01 Yury Semikhatsky <yurys@chromium.org>
3210 Memory instrumentation: report memory occupied by ResourceRequest instead of its base ResourceRequestBase
3211 https://bugs.webkit.org/show_bug.cgi?id=100497
3213 Reviewed by Alexander Pavlov.
3215 * wtf/MemoryInstrumentation.h:
3216 (WTF::MemoryClassInfo::addPrivateBuffer): do not report memory usage for empty buffer.
3218 2012-10-31 Anders Carlsson <andersca@apple.com>
3221 <rdar://problem/12612207>.
3223 Reviewed by Sam Weinig.
3225 * wtf/CheckedArithmetic.h:
3227 2012-10-31 Benjamin Poulain <bpoulain@apple.com>
3229 Add an optimized version of copyLCharsFromUCharSource for ARM
3230 https://bugs.webkit.org/show_bug.cgi?id=94886
3232 Reviewed by Gavin Barraclough.
3234 Michael Saboff added a SIMD version of copyLCharsFromUCharSource() in r125846.
3236 This patch a similar optimization for ARMv7 by using the interleaved load/store available
3237 in the NEON extension.
3239 The performance gains:
3240 -10000 characters: ~3.5 times faster.
3241 -20 characters (2 vectors): ~55% faster.
3242 -15 characters (1 vector): ~21% faster.
3243 -3 characters (no vector, pure overhead): ~10% slower.
3245 * wtf/text/ASCIIFastPath.h:
3246 (WTF::copyLCharsFromUCharSource):
3248 2012-10-31 Christophe Dumez <christophe.dumez@intel.com>
3250 [EFL][WK2][AC] Use smart pointers for Evas_GL types
3251 https://bugs.webkit.org/show_bug.cgi?id=100745
3253 Reviewed by Kenneth Rohde Christiansen.
3255 Make OwnPtr usable with Evas_GL type to avoid handling
3256 raw pointers in EFL port.
3258 * wtf/OwnPtrCommon.h:
3260 * wtf/efl/OwnPtrEfl.cpp:
3262 (WTF::deleteOwnedPtr):
3264 2012-10-29 Anders Carlsson <andersca@apple.com>
3266 Build WebKit as C++11 on Mac
3267 https://bugs.webkit.org/show_bug.cgi?id=100720
3269 Reviewed by Daniel Bates.
3271 * Configurations/Base.xcconfig:
3272 Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
3274 * wtf/text/AtomicString.cpp:
3275 (WTF::AtomicString::add):
3276 Change the type of length to be unsigned to prevent implicit type conversions in non-constant initializer lists.
3278 * wtf/unicode/UTF8.cpp:
3280 Add static_casts to prevent implicit type conversions in non-constant initializer lists.
3282 2012-10-29 Anders Carlsson <andersca@apple.com>
3284 String::createCFString should return a RetainPtr
3285 https://bugs.webkit.org/show_bug.cgi?id=100419
3287 Reviewed by Andreas Kling.
3289 Make String::createCFString and StringImpl::createCFString return RetainPtrs.
3291 * wtf/text/AtomicString.h:
3292 * wtf/text/StringImpl.h:
3293 * wtf/text/WTFString.h:
3295 2012-10-30 Mark Rowe <mrowe@apple.com>
3297 Fix WTF to not install a few header files in bogus locations.
3299 * WTF.xcodeproj/project.pbxproj:
3301 2012-10-28 Mark Rowe <mrowe@apple.com>
3303 Simplify Xcode configuration settings that used to vary between OS versions.
3305 Reviewed by Dan Bernstein.
3307 * Configurations/Base.xcconfig:
3308 * Configurations/DebugRelease.xcconfig:
3310 2012-10-28 Mark Rowe <mrowe@apple.com>
3312 Remove references to unsupported OS and Xcode versions.
3314 Reviewed by Anders Carlsson.
3316 * Configurations/Base.xcconfig:
3317 * Configurations/CompilerVersion.xcconfig: Removed.
3318 * Configurations/DebugRelease.xcconfig:
3319 * WTF.xcodeproj/project.pbxproj:
3321 2012-10-29 Anders Carlsson <andersca@apple.com>
3323 AtomicString(CFStringRef) shouldn't unconditionally create a StringImpl
3324 https://bugs.webkit.org/show_bug.cgi?id=100701
3326 Reviewed by Dan Bernstein.
3328 * wtf/text/AtomicString.h:
3329 (WTF::AtomicString::AtomicString):
3330 Change the constructors that take a CFStringRef and an NSString * to call AtomicString::add(CFStringRef)
3331 and remove AtomicString::createCFString.
3333 (WTF::AtomicString::add):
3334 Add new member function declaration. The definition is in a new file in WebCore, AtomicStringCF.cpp.
3335 Also, fix the overload of add that takes a const char* to call the right other overload instead of itself.
3337 2012-10-29 Adam Barth <abarth@webkit.org>
3339 Unreviewed. Correct my previous patch to disable external SVG
3340 references only on PLATFORM(CHROMIUM).
3344 2012-10-29 Adam Barth <abarth@webkit.org>
3346 Block SVG external references pending a security review
3347 https://bugs.webkit.org/show_bug.cgi?id=100635
3349 Reviewed by Eric Seidel.
3351 We need to do a security review of loading external SVG references
3352 before we're sure that it is safe.
3356 2012-10-29 Michael Saboff <msaboff@apple.com>
3358 String::split(UChar, Vector<String>&) shouldn't create a temporary String
3359 https://bugs.webkit.org/show_bug.cgi?id=100578
3361 Reviewed by Anders Carlsson.
3363 Changed split(UChar, Vector<String>&) to call split(UChar, bool, Vector<String>&) instead of creating a
3364 string and calling the split(String,...) version and moved it to WTFString.h. Also moved
3365 split(const String& separator, Vector<String>& result) to WTFString.h.
3367 * wtf/text/WTFString.cpp:
3368 (WTF::String::split):
3369 * wtf/text/WTFString.h:
3370 (WTF::String::split):
3372 2012-10-29 Sheriff Bot <webkit.review.bot@gmail.com>
3374 Unreviewed, rolling out r132736.
3375 http://trac.webkit.org/changeset/132736
3376 https://bugs.webkit.org/show_bug.cgi?id=100652
3378 It broke all plugin related tests on GTK and on Qt (Requested
3379 by Ossy on #webkit).
3381 * wtf/text/WTFString.cpp:
3382 (WTF::String::fromUTF8):
3384 2012-10-27 Michael Saboff <msaboff@apple.com>
3386 Try to create AtomicString as 8 bit where possible
3387 https://bugs.webkit.org/show_bug.cgi?id=100575
3389 Reviewed by Oliver Hunt.
3391 Added StringImpl::create8BitIfPossible() that first tries to create an 8 bit string. If it finds a 16 bit character
3392 during processing, it calls the standard create() method. The assumption is that this will be used on mostly 8 bit
3393 strings and ones that are shorter (in the tens of characters). Changed AtomicString to use the new creation method
3394 for UChar based construction.
3396 * wtf/text/AtomicString.cpp:
3397 (WTF::UCharBufferTranslator::translate):
3398 * wtf/text/StringImpl.cpp:
3399 (WTF::StringImpl::create8BitIfPossible):
3400 * wtf/text/StringImpl.h:
3401 (WTF::StringImpl::create8BitIfPossible):
3403 2012-10-27 Michael Saboff <msaboff@apple.com>
3405 String::fromUTF8() should take advantage of the ASCII check in convertUTF8ToUTF16()
3406 https://bugs.webkit.org/show_bug.cgi?id=100577
3408 Reviewed by Oliver Hunt.
3410 Passed is ASCII flag to convertUTF8ToUTF16() and if try, create an 8 bit string from the original arguments.
3412 * wtf/text/WTFString.cpp:
3413 (WTF::String::fromUTF8):
3415 2012-10-27 Dan Bernstein <mitz@apple.com>
3417 REAL_PLATFORM_NAME build setting is no longer needed
3418 https://bugs.webkit.org/show_bug.cgi?id=100587
3420 Reviewed by Mark Rowe.
3422 Removed the definition of REAL_PLATFORM_NAME and replaced references to it with references
3425 * Configurations/Base.xcconfig:
3426 * Configurations/CompilerVersion.xcconfig:
3427 * Configurations/DebugRelease.xcconfig:
3429 2012-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
3431 Unreviewed, rolling out r132689.
3432 http://trac.webkit.org/changeset/132689
3433 https://bugs.webkit.org/show_bug.cgi?id=100574
3435 Broke HashMaps containing RetainPtrs (Requested by andersca on
3440 2012-10-26 Anders Carlsson <andersca@apple.com>
3442 Add an operator& to RetainPtr
3443 https://bugs.webkit.org/show_bug.cgi?id=100549
3445 Reviewed by Dan Bernstein.
3447 This is useful for APIs that return references using out parameters.
3450 (WTF::RetainPtr::operator&):
3452 2012-10-26 Gabor Ballabas <gaborb@inf.u-szeged.hu>
3454 [Qt] Enable JSC's disassembler on x86, x86_64 Linux
3455 https://bugs.webkit.org/show_bug.cgi?id=100386
3457 Reviewed by Simon Hausmann.
3459 It works fine on Linux x86, x86_64 just needs to be enabled in the
3460 QtWebKit build system.
3464 2012-10-25 Michael Saboff <msaboff@apple.com>
3466 REGRESSION (r131836): failures in list styles tests on EFL, GTK
3467 https://bugs.webkit.org/show_bug.cgi?id=99824
3469 Reviewed by Oliver Hunt.
3472 Added placeholder argument for new argument added to convertUTF8ToUTF16() in http://trac.webkit.org/changeset/131836.
3474 * wtf/unicode/UTF8.cpp:
3475 (WTF::Unicode::convertUTF8ToUTF16):
3476 * wtf/unicode/glib/UnicodeGLib.cpp:
3477 (WTF::Unicode::convertCase):
3479 2012-10-25 Christophe Dumez <christophe.dumez@intel.com>
3481 [EFL][WK2] Remove some C'ism from EwkView
3482 https://bugs.webkit.org/show_bug.cgi?id=100370
3484 Reviewed by Kenneth Rohde Christiansen.
3486 Make OwnPtr useable for Ecore_IMF_Context to avoid
3487 using raw pointers in EFL port.
3489 * wtf/OwnPtrCommon.h:
3491 * wtf/PlatformEfl.cmake:
3492 * wtf/efl/OwnPtrEfl.cpp:
3493 (WTF::deleteOwnedPtr):
3496 2012-09-27 Yury Semikhatsky <yurys@chromium.org>
3498 Web Inspector: provide memory instrumentation for ListHashSet
3499 https://bugs.webkit.org/show_bug.cgi?id=97786
3501 Reviewed by Vsevolod Vlasov.
3503 Added memory instrumentation for ListHashSet.
3505 * GNUmakefile.list.am:
3508 * WTF.vcproj/WTF.vcproj:
3509 * WTF.xcodeproj/project.pbxproj:
3512 * wtf/ListHashSet.h:
3514 (ListHashSetNodeAllocator): changed visibility of inPool method to public
3515 (WTF::ListHashSetNodeAllocator::pool):
3516 (WTF::ListHashSetNodeAllocator::pastPool):
3517 (WTF::::sizeInBytes): added a method that returns size of the set in bytes including
3518 all its internals but not the content elements.
3520 * wtf/MemoryInstrumentation.h: removed onsolete method. All clients were updated to
3521 use generic addMember instead.
3522 (MemoryInstrumentation):
3523 (WTF::MemoryClassInfo::addPrivateBuffer):
3524 * wtf/MemoryInstrumentationHashSet.h:
3525 * wtf/MemoryInstrumentationListHashSet.h: Copied from Source/WTF/wtf/MemoryInstrumentationHashSet.h.
3527 (WTF::reportMemoryUsage):
3529 2012-10-23 Benjamin Poulain <benjamin@webkit.org>
3531 WTFURL: Implement KURL::setPort()
3532 https://bugs.webkit.org/show_bug.cgi?id=99898
3534 Reviewed by Adam Barth.
3536 Add an efficient implementation for remplacing the port component
3537 in an URL. This will be the base for replacing other components
3540 The testing is covered by fast/dom/HTMLAnchorElement/set-href-attribute-port.html
3542 * wtf/url/api/ParsedURL.cpp:
3543 (WTF::generateNewSpecWithPort):
3544 (WTF::replacePortWithString):
3545 (WTF::ParsedURL::replacePort):
3546 * wtf/url/api/ParsedURL.h:
3549 2012-10-22 Michael Saboff <msaboff@apple.com>
3551 Regression(r131655): Crash in StringImpl::findIgnoringCase
3552 https://bugs.webkit.org/show_bug.cgi?id=99753
3554 Reviewed by Geoffrey Garen.
3556 Fixed to use the searchLength to take into account the start index.
3558 Added LayoutTests/fast/js/find-ignoring-case-regress-99753.html
3560 * wtf/text/StringImpl.cpp:
3561 (WTF::StringImpl::findIgnoringCase):
3563 2012-10-22 Simon Hausmann <simon.hausmann@digia.com>
3565 Unreviewed: Re-enable LLINT on Qt/Linux after r131932.
3569 2012-10-22 Yury Semikhatsky <yurys@chromium.org>
3571 Web Inspector: do not double count memory of objects with multiple ancestors
3572 https://bugs.webkit.org/show_bug.cgi?id=99958
3574 Reviewed by Alexander Pavlov.
3576 Make sure memory occupied by objects of classes with multiple inheritance is
3579 * wtf/MemoryInstrumentation.h:
3580 (WTF::MemoryObjectInfo::MemoryObjectInfo):
3581 (WTF::MemoryObjectInfo::reportedPointer):
3582 (WTF::MemoryObjectInfo::reportObjectInfo): 1) Store actual pointer to the instrumented
3583 object as it may differ from the original pointer by which it was reported. 2) Make
3584 the method non-template and calculate object size on the caller side.
3586 (WTF::MemoryInstrumentation::reportObjectMemoryUsage):
3587 (WTF::MemoryClassInfo::MemoryClassInfo):
3588 (WTF::MemoryInstrumentation::InstrumentedPointer::process): use adjusted pointer
3589 returned by reportMemoryUsage to check if the object has already been visited when
3590 the pointer differs from the orinal one(it may happen if the object was reported
3591 by a pointer to one of its base classes).