Author: [EMAIL PROTECTED]
Date: Thu Oct 16 00:17:26 2008
New Revision: 509
Modified:
branches/bleeding_edge/src/objects-inl.h
Log:
-Eliminated a excessive memory traffic in CopyObject.
Review URL: http://codereview.chromium.org/7432
Modified: branches/bleeding_edge/src/objects-inl.h
==============================================================================
--- branches/bleeding_edge/src/objects-inl.h (original)
+++ branches/bleeding_edge/src/objects-inl.h Thu Oct 16 00:17:26 2008
@@ -627,23 +627,19 @@
bool MapWord::IsForwardingAddress() {
- // This function only works for map words that are heap object pointers.
- // Since it is a heap object, it has a map. We use that map's instance
- // type to detect if this map word is not actually a map (ie, it is a
- // forwarding address during a scavenge collection).
- return reinterpret_cast<HeapObject*>(value_)->map()->instance_type() !=
- MAP_TYPE;
+ return HAS_SMI_TAG(reinterpret_cast<Object*>(value_));
}
MapWord MapWord::FromForwardingAddress(HeapObject* object) {
- return MapWord(reinterpret_cast<uintptr_t>(object));
+ Address raw = reinterpret_cast<Address>(object) - kHeapObjectTag;
+ return MapWord(reinterpret_cast<uintptr_t>(raw));
}
HeapObject* MapWord::ToForwardingAddress() {
ASSERT(IsForwardingAddress());
- return reinterpret_cast<HeapObject*>(value_);
+ return HeapObject::FromAddress(reinterpret_cast<Address>(value_));
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---