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

Unified Diff: src/heap-inl.h

Issue 502100: When promoting objects during a copying collection, promote all... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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 | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-inl.h
===================================================================
--- src/heap-inl.h (revision 3515)
+++ src/heap-inl.h (working copy)
@@ -196,12 +196,23 @@
// other object types are promoted to old pointer space. We do not use
// object->IsHeapNumber() and object->IsSeqString() because we already
// know that object has the heap object tag.
- ASSERT((type != CODE_TYPE) && (type != MAP_TYPE));
- bool has_pointers =
- type != HEAP_NUMBER_TYPE &&
- (type >= FIRST_NONSTRING_TYPE ||
- (type & kStringRepresentationMask) != kSeqStringTag);
- return has_pointers ? OLD_POINTER_SPACE : OLD_DATA_SPACE;
+
+ // These objects are never allocated in new space.
+ ASSERT(type != MAP_TYPE);
+ ASSERT(type != CODE_TYPE);
+ ASSERT(type != ODDBALL_TYPE);
+ ASSERT(type != JS_GLOBAL_PROPERTY_CELL_TYPE);
+
+ if (type < FIRST_NONSTRING_TYPE) {
+ // There are three string representations: sequential strings, cons
+ // strings, and external strings. Only cons strings contain
+ // non-map-word pointers to heap objects.
+ return ((type & kStringRepresentationMask) == kConsStringTag)
+ ? OLD_POINTER_SPACE
+ : OLD_DATA_SPACE;
+ } else {
+ return (type <= LAST_DATA_TYPE) ? OLD_DATA_SPACE : OLD_POINTER_SPACE;
+ }
}
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698