[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 13:48:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 80b096c5df7d2103b2eef8a3469794cb17cade4a
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 27 19:18:17 2010 +0000

    Add WTF_MAKE_NONCOPYABLE macro
    https://bugs.webkit.org/show_bug.cgi?id=46589
    
    Reviewed by Alexey Proskuryakov and Adam Barth.
    
    Going forward, we'd like to get rid of the Noncopyable and FastAllocBase classes. The
    reason for this is that the Itanium C++ ABI states that no empty classes of the same type
    can be laid out at the same offset in the class. This can result in objects getting larger
    which leads to memory regressions. (One example of this is the String class which grew by
    sizeof(void*) when both its base class and its first member variable inherited indirectly
    from FastAllocBase).
    
    * wtf/Noncopyable.h:
    Add a WTF_MAKE_NONCOPYABLE macro and get rid of NoncopyableCustomAllocated.
    
    * runtime/JSCell.h:
    * wtf/RefCounted.h:
    Don't inherit from NoncopyableCustomAllocated. Instead, use WTF_MAKE_NONCOPYABLE.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68414 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 7838b99..2547ffc 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-09-26  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Alexey Proskuryakov and Adam Barth.
+
+        Add WTF_MAKE_NONCOPYABLE macro
+        https://bugs.webkit.org/show_bug.cgi?id=46589
+
+        Going forward, we'd like to get rid of the Noncopyable and FastAllocBase classes. The
+        reason for this is that the Itanium C++ ABI states that no empty classes of the same type
+        can be laid out at the same offset in the class. This can result in objects getting larger
+        which leads to memory regressions. (One example of this is the String class which grew by
+        sizeof(void*) when both its base class and its first member variable inherited indirectly
+        from FastAllocBase).
+
+        * wtf/Noncopyable.h:
+        Add a WTF_MAKE_NONCOPYABLE macro and get rid of NoncopyableCustomAllocated.
+        
+        * runtime/JSCell.h:
+        * wtf/RefCounted.h:
+        Don't inherit from NoncopyableCustomAllocated. Instead, use WTF_MAKE_NONCOPYABLE.
+
 2010-09-27  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 2ffce8d..653cd9e 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -34,7 +34,9 @@
 
 namespace JSC {
 
-    class JSCell : public NoncopyableCustomAllocated {
+    class JSCell {
+        WTF_MAKE_NONCOPYABLE(JSCell);
+
         friend class GetterSetter;
         friend class Heap;
         friend class JIT;
diff --git a/JavaScriptCore/wtf/Noncopyable.h b/JavaScriptCore/wtf/Noncopyable.h
index 60a46e2..61f2530 100644
--- a/JavaScriptCore/wtf/Noncopyable.h
+++ b/JavaScriptCore/wtf/Noncopyable.h
@@ -21,6 +21,26 @@
 #ifndef WTF_Noncopyable_h
 #define WTF_Noncopyable_h
 
+#ifndef __has_feature
+    #define __has_feature(x) 0
+#endif
+
+#if __has_feature(cxx_deleted_functions)
+    #define WTF_MAKE_NONCOPYABLE(ClassName) \
+        _Pragma("clang diagnostic push") \
+        _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") \
+        _Pragma("clang diagnostic ignored \"-Wc++0x-extensions\"") \
+        private: \
+            ClassName(const ClassName&) = delete; \
+            ClassName& operator=(const ClassName&) = delete; \
+        _Pragma("clang diagnostic pop")
+#else
+    #define WTF_MAKE_NONCOPYABLE(ClassName) \
+        private: \
+            ClassName(const ClassName&); \
+            ClassName& operator=(const ClassName&);
+#endif
+
 // We don't want argument-dependent lookup to pull in everything from the WTF
 // namespace when you use Noncopyable, so put it in its own namespace.
 
@@ -36,17 +56,8 @@ namespace WTFNoncopyable {
         ~Noncopyable() { }
     };
 
-    class NoncopyableCustomAllocated {
-        NoncopyableCustomAllocated(const NoncopyableCustomAllocated&);
-        NoncopyableCustomAllocated& operator=(const NoncopyableCustomAllocated&);
-    protected:
-        NoncopyableCustomAllocated() { }
-        ~NoncopyableCustomAllocated() { }
-    };
-
 } // namespace WTFNoncopyable
 
 using WTFNoncopyable::Noncopyable;
-using WTFNoncopyable::NoncopyableCustomAllocated;
 
 #endif // WTF_Noncopyable_h
diff --git a/JavaScriptCore/wtf/RefCounted.h b/JavaScriptCore/wtf/RefCounted.h
index d85c47e..8d8b302 100644
--- a/JavaScriptCore/wtf/RefCounted.h
+++ b/JavaScriptCore/wtf/RefCounted.h
@@ -145,7 +145,9 @@ protected:
     }
 };
 
-template<typename T> class RefCountedCustomAllocated : public RefCountedBase, public NoncopyableCustomAllocated {
+template<typename T> class RefCountedCustomAllocated : public RefCountedBase {
+    WTF_MAKE_NONCOPYABLE(RefCountedCustomAllocated);
+
 public:
     void deref()
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list