Commit 2cc62bc6 authored by benjamin@webkit.org's avatar benjamin@webkit.org

Unify Number to StringImpl conversion

https://bugs.webkit.org/show_bug.cgi?id=94879

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-24
Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* runtime/UString.cpp:
* runtime/UString.h:
(JSC::UString::number):
Update UString to directly use the common NumberToString implementation.

Source/WebKit2: 

* win/WebKit2.def: Update the exported symbols.

Source/WTF: 

Previously, UString::number() and String::number() used different implementations.

WTF::String::number() was simply forwarding to String::format().
UString::number() had an optimized version of the conversion.

This patch replace both implementation by a new version, faster than the two previous versions.

The new functions numberToStringImpl improvements are:
-about 3 times faster than String::number().
-14% faster than UString::number() on signed numbers.
-9% faster than UString::number() on unsigned numbers.

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/IntegerToStringConversion.cpp: Added.
(WTF::numberToStringImplSigned):
(WTF::numberToStringImpl):
(WTF::numberToStringImplUnsigned):
* wtf/text/IntegerToStringConversion.h: Added.
* wtf/text/WTFString.cpp:
(WTF::String::format):
* wtf/text/WTFString.h:
(WTF::String::number):

Tools: 

Add testing for the new IntegerToStringConversion.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/GNUmakefile.am:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/IntegerToStringConversion.cpp: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 30c19f71
2012-08-24 Benjamin Poulain <bpoulain@apple.com>
Unify Number to StringImpl conversion
https://bugs.webkit.org/show_bug.cgi?id=94879
Reviewed by Geoffrey Garen.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* runtime/UString.cpp:
* runtime/UString.h:
(JSC::UString::number):
Update UString to directly use the common NumberToString implementation.
2012-08-24 Oliver Hunt <oliver@apple.com>
Always null check cells before marking
......
......@@ -265,12 +265,15 @@ EXPORTS
?notifyWriteSlow@WatchpointSet@JSC@@QAEXXZ
?nullptr@@3Vnullptr_t@std@@A
?number@String@WTF@@SA?AV12@NII@Z
?number@UString@JSC@@SA?AV12@H@Z
?number@UString@JSC@@SA?AV12@I@Z
?number@UString@JSC@@SA?AV12@N@Z
?numberToFixedPrecisionString@WTF@@YAPBDNIQAD_N@Z
?numberToFixedWidthString@WTF@@YAPBDNIQAD@Z
?numberToString@WTF@@YAPBDNQAD@Z
?numberToStringImpl@WTF@@YA?AV?$PassRefPtr@VStringImpl@WTF@@@1@_J@Z
?numberToStringImpl@WTF@@YA?AV?$PassRefPtr@VStringImpl@WTF@@@1@_K@Z
?numberToStringImpl@WTF@@YA?AV?$PassRefPtr@VStringImpl@WTF@@@1@H@Z
?numberToStringImpl@WTF@@YA?AV?$PassRefPtr@VStringImpl@WTF@@@1@I@Z
?numberToStringImpl@WTF@@YA?AV?$PassRefPtr@VStringImpl@WTF@@@1@J@Z
?numberToStringImpl@WTF@@YA?AV?$PassRefPtr@VStringImpl@WTF@@@1@K@Z
?objectCount@Heap@JSC@@QAEIXZ
?objectProtoFuncToString@JSC@@YI_JPAVExecState@1@@Z
?objectTypeCounts@Heap@JSC@@QAE?AV?$PassOwnPtr@V?$HashCountedSet@PBDU?$PtrHash@PBD@WTF@@U?$HashTraits@PBD@2@@WTF@@@WTF@@XZ
......
......@@ -29,14 +29,10 @@
#include "Identifier.h"
#include "Operations.h"
#include <ctype.h>
#include <limits.h>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <wtf/ASCIICType.h>
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/Vector.h>
#include <wtf/dtoa.h>
#include <wtf/unicode/UTF8.h>
......@@ -94,115 +90,6 @@ UString::UString(const char* characters)
{
}
UString UString::number(int i)
{
LChar buf[1 + sizeof(i) * 3];
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
LChar* p = end;
if (i == 0)
*--p = '0';
else if (i == INT_MIN) {
char minBuf[1 + sizeof(i) * 3];
snprintf(minBuf, sizeof(minBuf), "%d", INT_MIN);
return UString(minBuf);
} else {
bool negative = false;
if (i < 0) {
negative = true;
i = -i;
}
while (i) {
*--p = static_cast<unsigned short>((i % 10) + '0');
i /= 10;
}
if (negative)
*--p = '-';
}
return UString(p, static_cast<unsigned>(end - p));
}
UString UString::number(long long i)
{
LChar buf[1 + sizeof(i) * 3];
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
LChar* p = end;
if (i == 0)
*--p = '0';
else if (i == std::numeric_limits<long long>::min()) {
char minBuf[1 + sizeof(i) * 3];
#if OS(WINDOWS)
snprintf(minBuf, sizeof(minBuf), "%I64d", std::numeric_limits<long long>::min());
#else
snprintf(minBuf, sizeof(minBuf), "%lld", std::numeric_limits<long long>::min());
#endif
return UString(minBuf);
} else {
bool negative = false;
if (i < 0) {
negative = true;
i = -i;
}
while (i) {
*--p = static_cast<unsigned short>((i % 10) + '0');
i /= 10;
}
if (negative)
*--p = '-';
}
return UString(p, static_cast<unsigned>(end - p));
}
UString UString::number(unsigned u)
{
LChar buf[sizeof(u) * 3];
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
LChar* p = end;
if (u == 0)
*--p = '0';
else {
while (u) {
*--p = static_cast<unsigned short>((u % 10) + '0');
u /= 10;
}
}
return UString(p, static_cast<unsigned>(end - p));
}
UString UString::number(long l)
{
LChar buf[1 + sizeof(l) * 3];
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
LChar* p = end;
if (l == 0)
*--p = '0';
else if (l == LONG_MIN) {
char minBuf[1 + sizeof(l) * 3];
snprintf(minBuf, sizeof(minBuf), "%ld", LONG_MIN);
return UString(minBuf);
} else {
bool negative = false;
if (l < 0) {
negative = true;
l = -l;
}
while (l) {
*--p = static_cast<unsigned short>((l % 10) + '0');
l /= 10;
}
if (negative)
*--p = '-';
}
return UString(p, end - p);
}
UString UString::number(double d)
{
NumberToStringBuffer buffer;
......
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
......@@ -23,6 +23,7 @@
#ifndef UString_h
#define UString_h
#include <wtf/text/IntegerToStringConversion.h>
#include <wtf/text/StringImpl.h>
namespace JSC {
......@@ -112,10 +113,10 @@ public:
return m_impl->characters16()[index];
}
JS_EXPORT_PRIVATE static UString number(int);
JS_EXPORT_PRIVATE static UString number(unsigned);
JS_EXPORT_PRIVATE static UString number(long);
static UString number(long long);
static UString number(int i) { return WTF::numberToStringImpl(i); }
static UString number(unsigned u) { return WTF::numberToStringImpl(u); }
static UString number(long i) { return WTF::numberToStringImpl(i); }
static UString number(long long i) { return WTF::numberToStringImpl(i); }
JS_EXPORT_PRIVATE static UString number(double);
// Find a single character or string, also with match function & latin1 forms.
......
2012-08-24 Benjamin Poulain <bpoulain@apple.com>
Unify Number to StringImpl conversion
https://bugs.webkit.org/show_bug.cgi?id=94879
Reviewed by Geoffrey Garen.
Previously, UString::number() and String::number() used different implementations.
WTF::String::number() was simply forwarding to String::format().
UString::number() had an optimized version of the conversion.
This patch replace both implementation by a new version, faster than the two previous versions.
The new functions numberToStringImpl improvements are:
-about 3 times faster than String::number().
-14% faster than UString::number() on signed numbers.
-9% faster than UString::number() on unsigned numbers.
* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/IntegerToStringConversion.cpp: Added.
(WTF::numberToStringImplSigned):
(WTF::numberToStringImpl):
(WTF::numberToStringImplUnsigned):
* wtf/text/IntegerToStringConversion.h: Added.
* wtf/text/WTFString.cpp:
(WTF::String::format):
* wtf/text/WTFString.h:
(WTF::String::number):
2012-08-24 Andras Becsi <andras.becsi@nokia.com>
[Qt] Be more explicit about the ICU dependency in the error message
......
......@@ -208,6 +208,8 @@ wtf_sources += \
Source/WTF/wtf/text/Base64.h \
Source/WTF/wtf/text/CString.cpp \
Source/WTF/wtf/text/CString.h \
Source/WTF/wtf/text/IntegerToStringConversion.cpp \
Source/WTF/wtf/text/IntegerToStringConversion.h \
Source/WTF/wtf/text/StringBuffer.h \
Source/WTF/wtf/text/StringBuilder.cpp \
Source/WTF/wtf/text/StringBuilder.h \
......
......@@ -113,6 +113,7 @@
'wtf/text/AtomicStringImpl.h',
'wtf/text/Base64.h',
'wtf/text/CString.h',
'wtf/text/IntegerToStringConversion.h',
'wtf/text/StringBuffer.h',
'wtf/text/StringBuilder.h',
'wtf/text/StringConcatenate.h',
......@@ -223,6 +224,7 @@
'wtf/text/AtomicString.cpp',
'wtf/text/Base64.cpp',
'wtf/text/CString.cpp',
'wtf/text/IntegerToStringConversion.cpp',
'wtf/text/StringBuilder.cpp',
'wtf/text/StringImpl.cpp',
'wtf/text/StringStatics.cpp',
......
......@@ -135,6 +135,7 @@ HEADERS += \
text/AtomicStringImpl.h \
text/Base64.h \
text/CString.h \
text/IntegerToStringConversion.h \
text/StringBuffer.h \
text/StringBuilder.h \
text/StringConcatenate.h \
......@@ -218,6 +219,7 @@ SOURCES += \
text/AtomicString.cpp \
text/Base64.cpp \
text/CString.cpp \
text/IntegerToStringConversion.cpp \
text/StringBuilder.cpp \
text/StringImpl.cpp \
text/StringStatics.cpp \
......
......@@ -423,6 +423,14 @@
RelativePath="..\wtf\text\CString.h"
>
</File>
<File
RelativePath="..\wtf\text\IntegerToStringConversion.cpp"
>
</File>
<File
RelativePath="..\wtf\text\IntegerToStringConversion.h"
>
</File>
<File
RelativePath="..\wtf\text\StringBuffer.h"
>
......
......@@ -11,6 +11,8 @@
143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; };
143F61201565F0F900DB514A /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (Private, ); }; };
14F3B0F715E45E4600210069 /* SaturatedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3B0F615E45E4600210069 /* SaturatedArithmetic.h */; settings = {ATTRIBUTES = (Private, ); }; };
26147B0915DDCCDC00DDB907 /* IntegerToStringConversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26147B0715DDCCDC00DDB907 /* IntegerToStringConversion.cpp */; };
26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */; };
2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C05385315BC819000F21B96 /* GregorianDateTime.h */; };
2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; };
4330F38F15745B0500AAFA8F /* URLString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4330F38E15745B0500AAFA8F /* URLString.cpp */; };
......@@ -256,6 +258,8 @@
143F611D1565F0F900DB514A /* RAMSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RAMSize.cpp; sourceTree = "<group>"; };
143F611E1565F0F900DB514A /* RAMSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAMSize.h; sourceTree = "<group>"; };
14F3B0F615E45E4600210069 /* SaturatedArithmetic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SaturatedArithmetic.h; sourceTree = "<group>"; };
26147B0715DDCCDC00DDB907 /* IntegerToStringConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntegerToStringConversion.cpp; sourceTree = "<group>"; };
26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegerToStringConversion.h; sourceTree = "<group>"; };
2C05385315BC819000F21B96 /* GregorianDateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GregorianDateTime.h; sourceTree = "<group>"; };
2CCD892915C0390200285083 /* GregorianDateTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GregorianDateTime.cpp; sourceTree = "<group>"; };
4330F38E15745B0500AAFA8F /* URLString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLString.cpp; sourceTree = "<group>"; };
......@@ -791,6 +795,8 @@
8134013715B092FD001FF0B8 /* Base64.h */,
A8A47321151A825B004123FF /* CString.cpp */,
A8A47322151A825B004123FF /* CString.h */,
26147B0715DDCCDC00DDB907 /* IntegerToStringConversion.cpp */,
26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */,
A8A47323151A825B004123FF /* StringBuffer.h */,
A8A47324151A825B004123FF /* StringBuilder.cpp */,
A8A47325151A825B004123FF /* StringBuilder.h */,
......@@ -958,6 +964,7 @@
A8A473DE151A825B004123FF /* Int16Array.h in Headers */,
A8A473DF151A825B004123FF /* Int32Array.h in Headers */,
A8A473DD151A825B004123FF /* Int8Array.h in Headers */,
26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */,
A8A473E0151A825B004123FF /* IntegralTypedArrayBase.h in Headers */,
A8A473E1151A825B004123FF /* ListHashSet.h in Headers */,
A8A473E2151A825B004123FF /* ListRefPtr.h in Headers */,
......@@ -1181,6 +1188,7 @@
A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */,
2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */,
A8A473D8151A825B004123FF /* HashTable.cpp in Sources */,
26147B0915DDCCDC00DDB907 /* IntegerToStringConversion.cpp in Sources */,
A8A473E5151A825B004123FF /* MainThread.cpp in Sources */,
A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */,
CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */,
......
......@@ -123,6 +123,7 @@ SET(WTF_HEADERS
text/AtomicStringImpl.h
text/Base64.h
text/CString.h
text/IntegerToStringConversion.h
text/StringBuffer.h
text/StringHash.h
text/StringImpl.h
......@@ -182,6 +183,7 @@ SET(WTF_SOURCES
text/AtomicString.cpp
text/Base64.cpp
text/CString.cpp
text/IntegerToStringConversion.cpp
text/StringBuilder.cpp
text/StringImpl.cpp
text/StringStatics.cpp
......
/*
* Copyright (C) 2012 Apple Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "IntegerToStringConversion.h"
#include <wtf/text/StringImpl.h>
namespace WTF {
template<typename T> struct UnsignedIntegerTrait;
template<> struct UnsignedIntegerTrait<short> {
typedef unsigned short Type;
};
template<> struct UnsignedIntegerTrait<int> {
typedef unsigned int Type;
};
template<> struct UnsignedIntegerTrait<long> {
typedef unsigned long Type;
};
template<> struct UnsignedIntegerTrait<long long> {
typedef unsigned long long Type;
};
template<typename SignedIntegerType>
static PassRefPtr<StringImpl> numberToStringImplSigned(SignedIntegerType integer)
{
LChar buf[1 + sizeof(SignedIntegerType) * 3];
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
LChar* p = end;
bool negative = false;
typename UnsignedIntegerTrait<SignedIntegerType>::Type unsignedInteger;
if (integer < 0) {
negative = true;
unsignedInteger = -integer;
} else
unsignedInteger = integer;
do {
*--p = static_cast<LChar>((unsignedInteger % 10) + '0');
unsignedInteger /= 10;
} while (unsignedInteger);
if (negative)
*--p = '-';
return StringImpl::create(p, static_cast<unsigned>(end - p));
}
PassRefPtr<StringImpl> numberToStringImpl(int i)
{
return numberToStringImplSigned(i);
}
PassRefPtr<StringImpl> numberToStringImpl(long i)
{
return numberToStringImplSigned(i);
}
PassRefPtr<StringImpl> numberToStringImpl(long long i)
{
return numberToStringImplSigned(i);
}
template<typename UnsignedIntegerType>
PassRefPtr<StringImpl> numberToStringImplUnsigned(UnsignedIntegerType integer)
{
LChar buf[sizeof(UnsignedIntegerType) * 3];
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
LChar* p = end;
do {
*--p = static_cast<LChar>((integer % 10) + '0');
integer /= 10;
} while (integer);
return StringImpl::create(p, static_cast<unsigned>(end - p));
}
PassRefPtr<StringImpl> numberToStringImpl(unsigned u)
{
return numberToStringImplUnsigned(u);
}
PassRefPtr<StringImpl> numberToStringImpl(unsigned long u)
{
return numberToStringImplUnsigned(u);
}
PassRefPtr<StringImpl> numberToStringImpl(unsigned long long u)
{
return numberToStringImplUnsigned(u);
}
} // namespace WTF
/*
* Copyright (C) 2012 Apple Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef IntegerToStringConversion_h
#define IntegerToStringConversion_h
#include "StringImpl.h"
namespace WTF {
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> numberToStringImpl(int);
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> numberToStringImpl(long);
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> numberToStringImpl(long long);
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> numberToStringImpl(unsigned);
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> numberToStringImpl(unsigned long);
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> numberToStringImpl(unsigned long long);
}
#endif // IntegerToStringConversion_h
......@@ -22,6 +22,7 @@
#include "config.h"
#include "WTFString.h"
#include "IntegerToStringConversion.h"
#include <stdarg.h>
#include <wtf/ASCIICType.h>
#include <wtf/DataLog.h>
......@@ -416,54 +417,6 @@ String String::format(const char *format, ...)
return StringImpl::create(reinterpret_cast<const LChar*>(buffer.data()), len);
#endif
}
String String::number(short n)
{
return String::format("%hd", n);
}
String String::number(unsigned short n)
{
return String::format("%hu", n);
}
String String::number(int n)
{
return String::format("%d", n);
}
String String::number(unsigned n)
{
return String::format("%u", n);
}
String String::number(long n)
{
return String::format("%ld", n);
}
String String::number(unsigned long n)
{
return String::format("%lu", n);
}
String String::number(long long n)
{
#if OS(WINDOWS) && !PLATFORM(QT)
return String::format("%I64i", n);
#else
return String::format("%lli", n);
#endif
}
String String::number(unsigned long long n)
{
#if OS(WINDOWS) && !PLATFORM(QT)
return String::format("%I64u", n);
#else
return String::format("%llu", n);
#endif
}
String String::number(double number, unsigned flags, unsigned precision)
{
......
/*
* (C) 1999 Lars Knoll (knoll@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -26,6 +26,7 @@
// on systems without case-sensitive file systems.
#include <wtf/text/ASCIIFastPath.h>
#include <wtf/text/IntegerToStringConversion.h>
#include <wtf/text/StringImpl.h>
#ifdef __OBJC__
......@@ -220,14 +221,14 @@ public:
return (*m_impl)[index];
}
static String number(short);
WTF_EXPORT_STRING_API static String number(unsigned short);
WTF_EXPORT_STRING_API static String number(int);
WTF_EXPORT_STRING_API static String number(unsigned);
WTF_EXPORT_STRING_API static String number(long);
WTF_EXPORT_STRING_API static String number(unsigned long);
WTF_EXPORT_STRING_API static String number(long long);
WTF_EXPORT_STRING_API static String number(unsigned long long);
static String number(unsigned short number) { return numberToStringImpl(number); }
static String number(int number) { return numberToStringImpl(number); }
static String number(unsigned number) { return numberToStringImpl(number); }
static String number(long number) { return numberToStringImpl(number); }
static String number(unsigned long number) { return numberToStringImpl(number); }
static String number(long long number) { return numberToStringImpl(number); }
static String number(unsigned long long number) { return numberToStringImpl(number); }
WTF_EXPORT_STRING_API static String number(double, unsigned = ShouldRoundSignificantFigures | ShouldTruncateTrailingZeros, unsigned precision = 6);
// Find a single character or string, also with match function & latin1 forms.
......
2012-08-24 Benjamin Poulain <bpoulain@apple.com>
Unify Number to StringImpl conversion
https://bugs.webkit.org/show_bug.cgi?id=94879
Reviewed by Geoffrey Garen.
* win/WebKit2.def: Update the exported symbols.