Revision: 6695
Author: [email protected]
Date: Wed Feb  9 04:35:18 2011
Log: Change our zap values from hex numbers tagged as a heap object to hex numbers tagged as a failure.

Since our zap values are valid heap object addreses we might hit asserts if a heap object gets the value of a zap constant as its address.

Review URL: http://codereview.chromium.org/6456022
http://code.google.com/p/v8/source/detail?r=6695

Modified:
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/v8globals.h

=======================================
--- /branches/bleeding_edge/src/heap.cc Fri Feb  4 05:43:38 2011
+++ /branches/bleeding_edge/src/heap.cc Wed Feb  9 04:35:18 2011
@@ -4128,7 +4128,7 @@

 #ifdef DEBUG
 void Heap::ZapFromSpace() {
-  ASSERT(reinterpret_cast<Object*>(kFromSpaceZapValue)->IsHeapObject());
+  ASSERT(reinterpret_cast<Object*>(kFromSpaceZapValue)->IsFailure());
   for (Address a = new_space_.FromSpaceLow();
        a < new_space_.FromSpaceHigh();
        a += kPointerSize) {
=======================================
--- /branches/bleeding_edge/src/v8globals.h     Fri Feb  4 10:15:49 2011
+++ /branches/bleeding_edge/src/v8globals.h     Wed Feb  9 04:35:18 2011
@@ -69,21 +69,21 @@


 // Zap-value: The value used for zapping dead objects.
-// Should be a recognizable hex value tagged as a heap object pointer.
+// Should be a recognizable hex value tagged as a failure.
 #ifdef V8_HOST_ARCH_64_BIT
 const Address kZapValue =
-    reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeed));
+    reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef));
 const Address kHandleZapValue =
-    reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddead));
+    reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf));
 const Address kFromSpaceZapValue =
-    reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdad));
+    reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdaf));
 const uint64_t kDebugZapValue = V8_UINT64_C(0xbadbaddbbadbaddb);
-const uint64_t kSlotsZapValue = V8_UINT64_C(0xbeefdeadbeefdeed);
+const uint64_t kSlotsZapValue = V8_UINT64_C(0xbeefdeadbeefdeef);
 #else
-const Address kZapValue = reinterpret_cast<Address>(0xdeadbeed);
-const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddead);
-const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdad);
-const uint32_t kSlotsZapValue = 0xbeefdeed;
+const Address kZapValue = reinterpret_cast<Address>(0xdeadbeef);
+const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf);
+const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf);
+const uint32_t kSlotsZapValue = 0xbeefdeef;
 const uint32_t kDebugZapValue = 0xbadbaddb;
 #endif

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

Reply via email to