Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: src/objects-inl.h

Issue 7432: -Eliminated a excessive memory traffic in CopyObject. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 508)
+++ src/objects-inl.h (working copy)
@@ -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_));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698