Title: [110891] trunk/Source/_javascript_Core
- Revision
- 110891
- Author
- [email protected]
- Date
- 2012-03-15 14:54:33 -0700 (Thu, 15 Mar 2012)
Log Message
NumericStrings should be inlined
https://bugs.webkit.org/show_bug.cgi?id=81183
Patch by Benjamin Poulain <[email protected]> on 2012-03-15
Reviewed by Gavin Barraclough.
NumericStrings is not always inlined. When it is not, the class is not faster
than using UString::number() directly.
* runtime/NumericStrings.h:
(JSC::NumericStrings::add):
(JSC::NumericStrings::lookupSmallString):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (110890 => 110891)
--- trunk/Source/_javascript_Core/ChangeLog 2012-03-15 21:46:12 UTC (rev 110890)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-03-15 21:54:33 UTC (rev 110891)
@@ -1,3 +1,17 @@
+2012-03-15 Benjamin Poulain <[email protected]>
+
+ NumericStrings should be inlined
+ https://bugs.webkit.org/show_bug.cgi?id=81183
+
+ Reviewed by Gavin Barraclough.
+
+ NumericStrings is not always inlined. When it is not, the class is not faster
+ than using UString::number() directly.
+
+ * runtime/NumericStrings.h:
+ (JSC::NumericStrings::add):
+ (JSC::NumericStrings::lookupSmallString):
+
2012-03-15 Andras Becsi <[email protected]>
Fix ARM build after r110792.
Modified: trunk/Source/_javascript_Core/runtime/NumericStrings.h (110890 => 110891)
--- trunk/Source/_javascript_Core/runtime/NumericStrings.h 2012-03-15 21:46:12 UTC (rev 110890)
+++ trunk/Source/_javascript_Core/runtime/NumericStrings.h 2012-03-15 21:54:33 UTC (rev 110891)
@@ -34,7 +34,7 @@
class NumericStrings {
public:
- UString add(double d)
+ ALWAYS_INLINE UString add(double d)
{
CacheEntry<double>& entry = lookup(d);
if (d == entry.key && !entry.value.isNull())
@@ -44,7 +44,7 @@
return entry.value;
}
- UString add(int i)
+ ALWAYS_INLINE UString add(int i)
{
if (static_cast<unsigned>(i) < cacheSize)
return lookupSmallString(static_cast<unsigned>(i));
@@ -56,7 +56,7 @@
return entry.value;
}
- UString add(unsigned i)
+ ALWAYS_INLINE UString add(unsigned i)
{
if (i < cacheSize)
return lookupSmallString(static_cast<unsigned>(i));
@@ -79,7 +79,7 @@
CacheEntry<double>& lookup(double d) { return doubleCache[WTF::FloatHash<double>::hash(d) & (cacheSize - 1)]; }
CacheEntry<int>& lookup(int i) { return intCache[WTF::IntHash<int>::hash(i) & (cacheSize - 1)]; }
CacheEntry<unsigned>& lookup(unsigned i) { return unsignedCache[WTF::IntHash<unsigned>::hash(i) & (cacheSize - 1)]; }
- const UString& lookupSmallString(unsigned i)
+ ALWAYS_INLINE const UString& lookupSmallString(unsigned i)
{
ASSERT(i < cacheSize);
if (smallIntCache[i].isNull())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes