Reviewers: Lasse Reichstein,

Description:
Add integer casts to make v8 compile without warnings on 64-bit Visual Studio

Please review this at http://codereview.chromium.org/650140

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/heap.h
  M     src/heap.cc
  M     src/scopeinfo.cc
  M     src/serialize.cc
  M     src/spaces-inl.h


Index: src/spaces-inl.h
===================================================================
--- src/spaces-inl.h    (revision 3923)
+++ src/spaces-inl.h    (working copy)
@@ -183,7 +183,7 @@

 int MemoryAllocator::GetChunkId(Page* p) {
   ASSERT(p->is_valid());
-  return p->opaque_header & Page::kPageAlignmentMask;
+  return static_cast<int>(p->opaque_header & Page::kPageAlignmentMask);
 }


Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 3923)
+++ src/heap.cc (working copy)
@@ -4111,7 +4111,7 @@
   // Uses only lower 32 bits if pointers are larger.
   uintptr_t addr_hash =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map)) >> kMapHashShift;
-  return (addr_hash ^ name->Hash()) & kCapacityMask;
+  return static_cast<uint32_t>((addr_hash ^ name->Hash()) & kCapacityMask);
 }


Index: src/serialize.cc
===================================================================
--- src/serialize.cc    (revision 3923)
+++ src/serialize.cc    (working copy)
@@ -852,10 +852,10 @@
   const int max_shift = ((kPointerSize * kBitsPerByte) / 7) * 7;
   for (int shift = max_shift; shift > 0; shift -= 7) {
     if (integer >= static_cast<uintptr_t>(1u) << shift) {
-      Put(((integer >> shift) & 0x7f) | 0x80, "IntPart");
+      Put((static_cast<int>((integer >> shift)) & 0x7f) | 0x80, "IntPart");
     }
   }
-  PutSection(integer & 0x7f, "IntLastPart");
+  PutSection(static_cast<int>(integer & 0x7f), "IntLastPart");
 }

 #ifdef DEBUG
Index: src/heap.h
===================================================================
--- src/heap.h  (revision 3923)
+++ src/heap.h  (working copy)
@@ -1383,9 +1383,9 @@
  private:
   static int Hash(DescriptorArray* array, String* name) {
     // Uses only lower 32 bits if pointers are larger.
-    uintptr_t array_hash =
+    uint32_t array_hash =
         static_cast<uint32_t>(reinterpret_cast<uintptr_t>(array)) >> 2;
-    uintptr_t name_hash =
+    uint32_t name_hash =
         static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)) >> 2;
     return (array_hash ^ name_hash) % kLength;
   }
Index: src/scopeinfo.cc
===================================================================
--- src/scopeinfo.cc    (revision 3923)
+++ src/scopeinfo.cc    (working copy)
@@ -536,7 +536,7 @@
   // Uses only lower 32 bits if pointers are larger.
   uintptr_t addr_hash =
       static_cast<uint32_t>(reinterpret_cast<uintptr_t>(code)) >> 2;
-  return (addr_hash ^ name->Hash()) % kLength;
+  return static_cast<int>((addr_hash ^ name->Hash()) % kLength);
 }




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to