Fix 32bit build.
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2011 21:08:27 +0000 (21:08 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Sep 2011 21:08:27 +0000 (21:08 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94448 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/NewSpace.h

index f9e5749..ec08bbc 100644 (file)
@@ -1,5 +1,13 @@
 2011-09-02  Oliver Hunt  <oliver@apple.com>
 
+        Fix 32bit build.
+
+        * heap/NewSpace.h:
+        (JSC::NewSpace::allocatePropertyStorage):
+        (JSC::NewSpace::inPropertyStorageNursery):
+
+2011-09-02  Oliver Hunt  <oliver@apple.com>
+
         Use bump allocator for initial property storage
         https://bugs.webkit.org/show_bug.cgi?id=67494
 
index 7abd48a..cf7ff31 100644 (file)
@@ -46,7 +46,7 @@ namespace JSC {
         WTF_MAKE_NONCOPYABLE(NewSpace);
     public:
         static const size_t maxCellSize = 1024;
-        static const ptrdiff_t PropertyStorageNurserySize = 1024 * 1024 * 4;
+        static const size_t PropertyStorageNurserySize = 1024 * 1024 * 4;
 
         struct SizeClass {
             SizeClass();
@@ -175,10 +175,10 @@ namespace JSC {
     inline void* NewSpace::allocatePropertyStorage(size_t size)
     {
         char* result = m_propertyStorageAllocationPoint;
-        if (size > static_cast<size_t>(PropertyStorageNurserySize))
+        if (size > PropertyStorageNurserySize)
             CRASH();
         m_propertyStorageAllocationPoint += size;
-        if ((m_propertyStorageAllocationPoint - m_propertyStorageNursery) > PropertyStorageNurserySize) {
+        if (static_cast<size_t>(m_propertyStorageAllocationPoint - m_propertyStorageNursery) > PropertyStorageNurserySize) {
             m_propertyStorageAllocationPoint = result;
             return 0;
         }
@@ -188,7 +188,7 @@ namespace JSC {
     inline bool NewSpace::inPropertyStorageNursery(void* ptr)
     {
         char* addr = static_cast<char*>(ptr);
-        return static_cast<uintptr_t>(addr - m_propertyStorageNursery) < PropertyStorageNurserySize;
+        return static_cast<size_t>(addr - m_propertyStorageNursery) < PropertyStorageNurserySize;
     }
     
     template <typename Functor> inline typename Functor::ReturnType NewSpace::forEachBlock(Functor& functor)