Title: [141916] trunk/Source
Revision
141916
Author
[email protected]
Date
2013-02-05 12:43:27 -0800 (Tue, 05 Feb 2013)

Log Message

Structure::m_outOfLineCapacity is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=108206

Reviewed by Darin Adler.

Simplifying the utility functions that we use since we don't need a 
bunch of fancy templates for this one specific call site.

Source/_javascript_Core: 

* runtime/Structure.h:
(JSC::Structure::outOfLineCapacity):

Source/WTF: 

* wtf/MathExtras.h:
(WTF::roundUpToPowerOfTwo):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (141915 => 141916)


--- trunk/Source/_javascript_Core/ChangeLog	2013-02-05 20:41:07 UTC (rev 141915)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-02-05 20:43:27 UTC (rev 141916)
@@ -1,3 +1,16 @@
+2013-02-04  Mark Hahnenberg  <[email protected]>
+
+        Structure::m_outOfLineCapacity is unnecessary
+        https://bugs.webkit.org/show_bug.cgi?id=108206
+
+        Reviewed by Darin Adler.
+
+        Simplifying the utility functions that we use since we don't need a 
+        bunch of fancy templates for this one specific call site.
+
+        * runtime/Structure.h:
+        (JSC::Structure::outOfLineCapacity):
+
 2013-02-05  Mark Hahnenberg  <[email protected]>
 
         Objective-C API: testapi.mm should use ARC

Modified: trunk/Source/_javascript_Core/runtime/Structure.h (141915 => 141916)


--- trunk/Source/_javascript_Core/runtime/Structure.h	2013-02-05 20:41:07 UTC (rev 141915)
+++ trunk/Source/_javascript_Core/runtime/Structure.h	2013-02-05 20:43:27 UTC (rev 141916)
@@ -196,7 +196,8 @@
                 return initialOutOfLineCapacity;
 
             ASSERT(outOfLineSize > initialOutOfLineCapacity);
-            return WTF::roundUpToPowerOf<outOfLineGrowthFactor>(outOfLineSize);
+            COMPILE_ASSERT(outOfLineGrowthFactor == 2, outOfLineGrowthFactor_is_two);
+            return WTF::roundUpToPowerOfTwo(outOfLineSize);
         }
         unsigned outOfLineSize() const
         {

Modified: trunk/Source/WTF/ChangeLog (141915 => 141916)


--- trunk/Source/WTF/ChangeLog	2013-02-05 20:41:07 UTC (rev 141915)
+++ trunk/Source/WTF/ChangeLog	2013-02-05 20:43:27 UTC (rev 141916)
@@ -1,3 +1,16 @@
+2013-02-04  Mark Hahnenberg  <[email protected]>
+
+        Structure::m_outOfLineCapacity is unnecessary
+        https://bugs.webkit.org/show_bug.cgi?id=108206
+
+        Reviewed by Darin Adler.
+
+        Simplifying the utility functions that we use since we don't need a 
+        bunch of fancy templates for this one specific call site.
+
+        * wtf/MathExtras.h:
+        (WTF::roundUpToPowerOfTwo):
+
 2013-02-05  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r141905.

Modified: trunk/Source/WTF/wtf/MathExtras.h (141915 => 141916)


--- trunk/Source/WTF/wtf/MathExtras.h	2013-02-05 20:41:07 UTC (rev 141915)
+++ trunk/Source/WTF/wtf/MathExtras.h	2013-02-05 20:43:27 UTC (rev 141916)
@@ -431,14 +431,8 @@
 
 namespace WTF {
 
-// Be careful, this might be super slow in a hot loop.
-template<size_t exponent> inline size_t roundUpToPowerOf(size_t v)
-{
-    return round(pow(static_cast<double>(exponent), ceil(log(static_cast<double>(v)) / log(static_cast<double>(exponent)))));
-}
-
 // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
-template<> inline size_t roundUpToPowerOf<2>(size_t v)
+inline uint32_t roundUpToPowerOfTwo(uint32_t v)
 {
     v--;
     v |= v >> 1;
@@ -446,9 +440,6 @@
     v |= v >> 4;
     v |= v >> 8;
     v |= v >> 16;
-#if defined(__LP64__) && __LP64__
-    v |= v >> 32;
-#endif
     v++;
     return v;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to