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

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

Issue 14208005: Use worst-fit allocation in old space for prentured objects. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/heap-inl.h ('k') | src/runtime.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 LO_SPACE); 2669 LO_SPACE);
2670 heap()->mark_compact_collector()->tracer()-> 2670 heap()->mark_compact_collector()->tracer()->
2671 increment_promoted_objects_size(object_size); 2671 increment_promoted_objects_size(object_size);
2672 return true; 2672 return true;
2673 } 2673 }
2674 } else { 2674 } else {
2675 OldSpace* target_space = heap()->TargetSpace(object); 2675 OldSpace* target_space = heap()->TargetSpace(object);
2676 2676
2677 ASSERT(target_space == heap()->old_pointer_space() || 2677 ASSERT(target_space == heap()->old_pointer_space() ||
2678 target_space == heap()->old_data_space()); 2678 target_space == heap()->old_data_space());
2679 MaybeObject* maybe_result = target_space->AllocateRaw(object_size); 2679 MaybeObject* maybe_result =
2680 target_space->AllocateRaw<FreeList::BEST_FIT>(object_size);
2680 if (maybe_result->ToObject(&result)) { 2681 if (maybe_result->ToObject(&result)) {
2681 HeapObject* target = HeapObject::cast(result); 2682 HeapObject* target = HeapObject::cast(result);
2682 MigrateObject(target->address(), 2683 MigrateObject(target->address(),
2683 object->address(), 2684 object->address(),
2684 object_size, 2685 object_size,
2685 target_space->identity()); 2686 target_space->identity());
2686 heap()->mark_compact_collector()->tracer()-> 2687 heap()->mark_compact_collector()->tracer()->
2687 increment_promoted_objects_size(object_size); 2688 increment_promoted_objects_size(object_size);
2688 return true; 2689 return true;
2689 } 2690 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 if (cells[cell_index] == 0) continue; 2793 if (cells[cell_index] == 0) continue;
2793 2794
2794 int live_objects = MarkWordToObjectStarts(cells[cell_index], offsets); 2795 int live_objects = MarkWordToObjectStarts(cells[cell_index], offsets);
2795 for (int i = 0; i < live_objects; i++) { 2796 for (int i = 0; i < live_objects; i++) {
2796 Address object_addr = cell_base + offsets[i] * kPointerSize; 2797 Address object_addr = cell_base + offsets[i] * kPointerSize;
2797 HeapObject* object = HeapObject::FromAddress(object_addr); 2798 HeapObject* object = HeapObject::FromAddress(object_addr);
2798 ASSERT(Marking::IsBlack(Marking::MarkBitFrom(object))); 2799 ASSERT(Marking::IsBlack(Marking::MarkBitFrom(object)));
2799 2800
2800 int size = object->Size(); 2801 int size = object->Size();
2801 2802
2802 MaybeObject* target = space->AllocateRaw(size); 2803 MaybeObject* target = space->AllocateRaw<FreeList::BEST_FIT>(size);
2803 if (target->IsFailure()) { 2804 if (target->IsFailure()) {
2804 // OS refused to give us memory. 2805 // OS refused to give us memory.
2805 V8::FatalProcessOutOfMemory("Evacuation"); 2806 V8::FatalProcessOutOfMemory("Evacuation");
2806 return; 2807 return;
2807 } 2808 }
2808 2809
2809 Object* target_object = target->ToObjectUnchecked(); 2810 Object* target_object = target->ToObjectUnchecked();
2810 2811
2811 MigrateObject(HeapObject::cast(target_object)->address(), 2812 MigrateObject(HeapObject::cast(target_object)->address(),
2812 object_addr, 2813 object_addr,
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4131 while (buffer != NULL) { 4132 while (buffer != NULL) {
4132 SlotsBuffer* next_buffer = buffer->next(); 4133 SlotsBuffer* next_buffer = buffer->next();
4133 DeallocateBuffer(buffer); 4134 DeallocateBuffer(buffer);
4134 buffer = next_buffer; 4135 buffer = next_buffer;
4135 } 4136 }
4136 *buffer_address = NULL; 4137 *buffer_address = NULL;
4137 } 4138 }
4138 4139
4139 4140
4140 } } // namespace v8::internal 4141 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698