Commit 1524ed50 authored by mrowe@apple.com's avatar mrowe@apple.com
Browse files

<rdar://problem/15079224> WTF fails to build with newer versions of clang.

Reviewed by Sam Weinig.

* wtf/DateMath.cpp: Remove some unused constants.
* wtf/FastMalloc.cpp: #if some constants and functions that are unused in some configurations.
Remove a function that's unused on all platforms.
* wtf/TCSystemAlloc.cpp: Remove some unused constants.
(TCMalloc_SystemRelease): Remove an if whose body is never executed.
* wtf/dtoa.cpp: #if things such that storeInc is only defined when USE_LONG_LONG is undefined.
Remove an unused constant.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 14deeab8
2013-09-28 Mark Rowe <mrowe@apple.com>
<rdar://problem/15079224> WTF fails to build with newer versions of clang.
Reviewed by Sam Weinig.
* wtf/DateMath.cpp: Remove some unused constants.
* wtf/FastMalloc.cpp: #if some constants and functions that are unused in some configurations.
Remove a function that's unused on all platforms.
* wtf/TCSystemAlloc.cpp: Remove some unused constants.
(TCMalloc_SystemRelease): Remove an if whose body is never executed.
* wtf/dtoa.cpp: #if things such that storeInc is only defined when USE_LONG_LONG is undefined.
Remove an unused constant.
2013-09-27 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
 
[Nix] Updating Nix trunk files
......
......@@ -113,11 +113,6 @@ namespace WTF {
/* Constants */
static const double minutesPerDay = 24.0 * 60.0;
static const double secondsPerYear = 24.0 * 60.0 * 60.0 * 365.0;
static const double usecPerSec = 1000000.0;
static const double maxUnixTime = 2145859200.0; // 12/31/2037
// ECMAScript asks not to support for a date of which total
// millisecond value is larger than the following value.
......
......@@ -515,7 +515,10 @@ namespace WTF {
#define MESSAGE LOG_ERROR
#define CHECK_CONDITION ASSERT
#if !OS(DARWIN)
static const char kLLHardeningMask = 0;
#endif
template <unsigned> struct EntropySource;
template <> struct EntropySource<4> {
static uint32_t value()
......@@ -881,15 +884,6 @@ static ALWAYS_INLINE void SLL_PushRange(HardenedSLL *head, HardenedSLL start, Ha
*head = start;
}
static ALWAYS_INLINE size_t SLL_Size(HardenedSLL head, uintptr_t entropy) {
int count = 0;
while (head) {
count++;
head = SLL_Next(head, entropy);
}
return count;
}
// Setup helper functions.
static ALWAYS_INLINE size_t SizeClass(size_t size) {
......@@ -4009,12 +4003,14 @@ static Span* DoSampledAllocation(size_t size) {
}
#endif
#if !ASSERT_DISABLED
static inline bool CheckCachedSizeClass(void *ptr) {
PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift;
size_t cached_value = pageheap->GetSizeClassIfCached(p);
return cached_value == 0 ||
cached_value == pageheap->GetDescriptor(p)->sizeclass;
}
#endif
static inline void* CheckedMallocResult(void *result)
{
......@@ -4193,11 +4189,11 @@ static void* do_memalign(size_t align, size_t size) {
static inline void do_malloc_stats() {
PrintStats(1);
}
#endif
static inline int do_mallopt(int, int) {
return 1; // Indicates error
}
#endif
#ifdef HAVE_STRUCT_MALLINFO // mallinfo isn't defined on freebsd, for instance
static inline struct mallinfo do_mallinfo() {
......
......@@ -99,9 +99,6 @@ DEFINE_int32(malloc_devmem_start, 0,
DEFINE_int32(malloc_devmem_limit, 0,
"Physical memory limit location in MB for /dev/mem allocation."
" Setting this to 0 means no limit.");
#else
static const int32_t FLAGS_malloc_devmem_start = 0;
static const int32_t FLAGS_malloc_devmem_limit = 0;
#endif
#ifndef WTF_CHANGES
......@@ -402,11 +399,6 @@ void TCMalloc_SystemRelease(void* start, size_t length)
#else
const int advice = MADV_DONTNEED;
#endif
if (FLAGS_malloc_devmem_start) {
// It's not safe to use MADV_DONTNEED if we've been mapping
// /dev/mem for heap memory
return;
}
if (pagesize == 0) pagesize = getpagesize();
const size_t pagemask = pagesize - 1;
......
......@@ -46,6 +46,12 @@
#pragma warning(disable: 4554)
#endif
#if CPU(PPC64) || CPU(X86_64)
// FIXME: should we enable this on all 64-bit CPUs?
// 64-bit emulation provided by the compiler is likely to be slower than dtoa own code on 32-bit hardware.
#define USE_LONG_LONG
#endif
namespace WTF {
Mutex* s_dtoaP5Mutex;
......@@ -64,6 +70,7 @@ typedef union {
#endif
#define dval(x) (x)->d
#ifndef USE_LONG_LONG
/* The following definition of Storeinc is appropriate for MIPS processors.
* An alternative that might be better on some machines is
* *p++ = high << 16 | low & 0xffff;
......@@ -81,6 +88,8 @@ static ALWAYS_INLINE uint32_t* storeInc(uint32_t* p, uint16_t high, uint16_t low
return p + 1;
}
#endif // USE_LONG_LONG
#define Exp_shift 20
#define Exp_shift1 20
#define Exp_msk1 0x100000
......@@ -112,12 +121,6 @@ static ALWAYS_INLINE uint32_t* storeInc(uint32_t* p, uint16_t high, uint16_t low
#define Big0 (Frac_mask1 | Exp_msk1 * (DBL_MAX_EXP + Bias - 1))
#define Big1 0xffffffff
#if CPU(PPC64) || CPU(X86_64)
// FIXME: should we enable this on all 64-bit CPUs?
// 64-bit emulation provided by the compiler is likely to be slower than dtoa own code on 32-bit hardware.
#define USE_LONG_LONG
#endif
struct BigInt {
BigInt() : sign(0) { }
int sign;
......@@ -596,13 +599,7 @@ static const double tens[] = {
};
static const double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 };
static const double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
9007199254740992. * 9007199254740992.e-256
/* = 2^106 * 1e-256 */
};
/* The factor of 2^53 in tinytens[4] helps us avoid setting the underflow */
/* flag unnecessarily. It leads to a song and dance at the end of strtod. */
#define Scale_Bit 0x10
#define n_bigtens 5
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment