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

Side by Side Diff: src/heap.cc

Issue 67126: Move STATIC_ASSERT to IsShortcutCandidate to fix the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 *p = first_word.ToForwardingAddress(); 832 *p = first_word.ToForwardingAddress();
833 return; 833 return;
834 } 834 }
835 835
836 // Call the slow part of scavenge object. 836 // Call the slow part of scavenge object.
837 return ScavengeObjectSlow(p, object); 837 return ScavengeObjectSlow(p, object);
838 } 838 }
839 839
840 840
841 static inline bool IsShortcutCandidate(HeapObject* object, Map* map) { 841 static inline bool IsShortcutCandidate(HeapObject* object, Map* map) {
842 STATIC_ASSERT(kNotStringTag != 0 && kSymbolTag != 0);
842 ASSERT(object->map() == map); 843 ASSERT(object->map() == map);
843 InstanceType type = map->instance_type(); 844 InstanceType type = map->instance_type();
844 if ((type & kShortcutTypeMask) != kShortcutTypeTag) return false; 845 if ((type & kShortcutTypeMask) != kShortcutTypeTag) return false;
845 ASSERT(object->IsString() && !object->IsSymbol()); 846 ASSERT(object->IsString() && !object->IsSymbol());
846 return ConsString::cast(object)->unchecked_second() == Heap::empty_string(); 847 return ConsString::cast(object)->unchecked_second() == Heap::empty_string();
847 } 848 }
848 849
849 850
850 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) { 851 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) {
851 ASSERT(InFromSpace(object)); 852 ASSERT(InFromSpace(object));
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after
3380 #ifdef DEBUG 3381 #ifdef DEBUG
3381 bool Heap::GarbageCollectionGreedyCheck() { 3382 bool Heap::GarbageCollectionGreedyCheck() {
3382 ASSERT(FLAG_gc_greedy); 3383 ASSERT(FLAG_gc_greedy);
3383 if (Bootstrapper::IsActive()) return true; 3384 if (Bootstrapper::IsActive()) return true;
3384 if (disallow_allocation_failure()) return true; 3385 if (disallow_allocation_failure()) return true;
3385 return CollectGarbage(0, NEW_SPACE); 3386 return CollectGarbage(0, NEW_SPACE);
3386 } 3387 }
3387 #endif 3388 #endif
3388 3389
3389 } } // namespace v8::internal 3390 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698