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

Side by Side Diff: src/mark-compact.cc

Issue 136001: Changed allocation to allow large objects to be allocated in new space.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 offset < free_size; 940 offset < free_size;
941 offset += kPointerSize) { 941 offset += kPointerSize) {
942 Memory::Address_at(free_start + offset) = kZapValue; 942 Memory::Address_at(free_start + offset) = kZapValue;
943 } 943 }
944 } 944 }
945 #endif 945 #endif
946 } 946 }
947 947
948 948
949 // Try to promote all objects in new space. Heap numbers and sequential 949 // Try to promote all objects in new space. Heap numbers and sequential
950 // strings are promoted to the code space, all others to the old space. 950 // strings are promoted to the code space, all others to the old space.
Mads Ager (chromium) 2009/06/18 14:01:20 Not your code, but this comment seems wrong. Heap
951 inline Object* MCAllocateFromNewSpace(HeapObject* object, int object_size) { 951 inline Object* MCAllocateFromNewSpace(HeapObject* object, int object_size) {
952 OldSpace* target_space = Heap::TargetSpace(object); 952 Object* forwarded ;
Mads Ager (chromium) 2009/06/18 14:01:20 Remove space before ';'.
953 ASSERT(target_space == Heap::old_pointer_space() || 953 if (object_size > Heap::MaxObjectSizeInPagedSpace()) {
954 target_space == Heap::old_data_space()); 954 forwarded = Failure::Exception();
955 Object* forwarded = target_space->MCAllocateRaw(object_size); 955 } else {
956 956 OldSpace* target_space = Heap::TargetSpace(object);
957 ASSERT(target_space == Heap::old_pointer_space() ||
958 target_space == Heap::old_data_space());
959 forwarded = target_space->MCAllocateRaw(object_size);
960 }
957 if (forwarded->IsFailure()) { 961 if (forwarded->IsFailure()) {
958 forwarded = Heap::new_space()->MCAllocateRaw(object_size); 962 forwarded = Heap::new_space()->MCAllocateRaw(object_size);
959 } 963 }
960 return forwarded; 964 return forwarded;
961 } 965 }
962 966
963 967
964 // Allocation functions for the paged spaces call the space's MCAllocateRaw. 968 // Allocation functions for the paged spaces call the space's MCAllocateRaw.
965 inline Object* MCAllocateFromOldPointerSpace(HeapObject* object, 969 inline Object* MCAllocateFromOldPointerSpace(HeapObject* object,
966 int object_size) { 970 int object_size) {
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 obj->set_map(reinterpret_cast<Map*>(HeapObject::FromAddress(map_addr))); 1671 obj->set_map(reinterpret_cast<Map*>(HeapObject::FromAddress(map_addr)));
1668 1672
1669 // This is a non-map object, it relies on the assumption that the Map space 1673 // This is a non-map object, it relies on the assumption that the Map space
1670 // is compacted before the Old space (see RelocateObjects). 1674 // is compacted before the Old space (see RelocateObjects).
1671 int obj_size = obj->Size(); 1675 int obj_size = obj->Size();
1672 ASSERT_OBJECT_SIZE(obj_size); 1676 ASSERT_OBJECT_SIZE(obj_size);
1673 1677
1674 ASSERT(space->MCSpaceOffsetForAddress(new_addr) <= 1678 ASSERT(space->MCSpaceOffsetForAddress(new_addr) <=
1675 space->MCSpaceOffsetForAddress(obj->address())); 1679 space->MCSpaceOffsetForAddress(obj->address()));
1676 1680
1677 space->MCAdjustRelocationEnd(new_addr, obj_size); 1681 reinterpret_cast<OldSpace*>(space)->MCAdjustRelocationEnd(new_addr, obj_size);
Mads Ager (chromium) 2009/06/18 14:01:20 space is already has type OldSpace*, so there shou
1678 1682
1679 #ifdef DEBUG 1683 #ifdef DEBUG
1680 if (FLAG_gc_verbose) { 1684 if (FLAG_gc_verbose) {
1681 PrintF("relocate %p -> %p\n", obj->address(), new_addr); 1685 PrintF("relocate %p -> %p\n", obj->address(), new_addr);
1682 } 1686 }
1683 #endif 1687 #endif
1684 1688
1685 return obj_size; 1689 return obj_size;
1686 } 1690 }
1687 1691
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 1799
1796 void MarkCompactCollector::RebuildRSets() { 1800 void MarkCompactCollector::RebuildRSets() {
1797 #ifdef DEBUG 1801 #ifdef DEBUG
1798 ASSERT(state_ == RELOCATE_OBJECTS); 1802 ASSERT(state_ == RELOCATE_OBJECTS);
1799 state_ = REBUILD_RSETS; 1803 state_ = REBUILD_RSETS;
1800 #endif 1804 #endif
1801 Heap::RebuildRSets(); 1805 Heap::RebuildRSets();
1802 } 1806 }
1803 1807
1804 } } // namespace v8::internal 1808 } } // namespace v8::internal
OLDNEW
« src/heap.cc ('K') | « src/ia32/builtins-ia32.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698