From: ricow@chromium.org Date: Wed, 9 Feb 2011 12:35:18 +0000 (+0000) Subject: Change our zap values from hex numbers tagged as a heap object to hex numbers tagged... X-Git-Tag: upstream/4.7.83~20285 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=baa3eed7109ebdd2ca418e9b6587212b639735e3;p=platform%2Fupstream%2Fv8.git 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 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6695 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/heap.cc b/src/heap.cc index 0e3a2b8..f88ebda 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -4128,7 +4128,7 @@ bool Heap::LookupSymbolIfExists(String* string, String** symbol) { #ifdef DEBUG void Heap::ZapFromSpace() { - ASSERT(reinterpret_cast(kFromSpaceZapValue)->IsHeapObject()); + ASSERT(reinterpret_cast(kFromSpaceZapValue)->IsFailure()); for (Address a = new_space_.FromSpaceLow(); a < new_space_.FromSpaceHigh(); a += kPointerSize) { diff --git a/src/v8globals.h b/src/v8globals.h index 85bd17e..d11bc38 100644 --- a/src/v8globals.h +++ b/src/v8globals.h @@ -69,21 +69,21 @@ const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1; // 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
(V8_UINT64_C(0xdeadbeedbeadbeed)); + reinterpret_cast
(V8_UINT64_C(0xdeadbeedbeadbeef)); const Address kHandleZapValue = - reinterpret_cast
(V8_UINT64_C(0x1baddead0baddead)); + reinterpret_cast
(V8_UINT64_C(0x1baddead0baddeaf)); const Address kFromSpaceZapValue = - reinterpret_cast
(V8_UINT64_C(0x1beefdad0beefdad)); + reinterpret_cast
(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
(0xdeadbeed); -const Address kHandleZapValue = reinterpret_cast
(0xbaddead); -const Address kFromSpaceZapValue = reinterpret_cast
(0xbeefdad); -const uint32_t kSlotsZapValue = 0xbeefdeed; +const Address kZapValue = reinterpret_cast
(0xdeadbeef); +const Address kHandleZapValue = reinterpret_cast
(0xbaddeaf); +const Address kFromSpaceZapValue = reinterpret_cast
(0xbeefdaf); +const uint32_t kSlotsZapValue = 0xbeefdeef; const uint32_t kDebugZapValue = 0xbadbaddb; #endif