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

Unified Diff: src/heap.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | src/spaces.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 7eb6881e9a2726265aebd8945eda5062412ac974..315f7a6931611a47b18a08554813060b78b712c6 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -753,7 +753,8 @@ void Heap::ReserveSpace(
if (space == NEW_SPACE) {
allocation = new_space()->AllocateRaw(sizes[space]);
} else {
- allocation = paged_space(space)->AllocateRaw(sizes[space]);
+ allocation = paged_space(space)->
+ AllocateRaw<FreeList::BEST_FIT>(sizes[space]);
}
FreeListNode* node;
if (!allocation->To<FreeListNode>(&node)) {
@@ -1913,10 +1914,12 @@ class ScavengingVisitor : public StaticVisitorBase {
NOT_EXECUTABLE);
} else {
if (object_contents == DATA_OBJECT) {
- maybe_result = heap->old_data_space()->AllocateRaw(allocation_size);
+ maybe_result = heap->old_data_space()->
+ AllocateRaw<FreeList::BEST_FIT>(allocation_size);
} else {
maybe_result =
- heap->old_pointer_space()->AllocateRaw(allocation_size);
+ heap->old_pointer_space()->
+ AllocateRaw<FreeList::BEST_FIT>(allocation_size);
}
}
@@ -3685,7 +3688,7 @@ MaybeObject* Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
int size = ByteArray::SizeFor(length);
Object* result;
{ MaybeObject* maybe_result = (size <= Page::kMaxNonCodeHeapObjectSize)
- ? old_data_space_->AllocateRaw(size)
+ ? old_data_space_->AllocateRaw<FreeList::BEST_FIT>(size)
: lo_space_->AllocateRaw(size, NOT_EXECUTABLE);
if (!maybe_result->ToObject(&result)) return maybe_result;
}
@@ -3774,7 +3777,7 @@ MaybeObject* Heap::CreateCode(const CodeDesc& desc,
if (force_lo_space) {
maybe_result = lo_space_->AllocateRaw(obj_size, EXECUTABLE);
} else {
- maybe_result = code_space_->AllocateRaw(obj_size);
+ maybe_result = code_space_->AllocateRaw<FreeList::BEST_FIT>(obj_size);
}
if (!maybe_result->To<HeapObject>(&result)) return maybe_result;
@@ -3836,7 +3839,7 @@ MaybeObject* Heap::CopyCode(Code* code) {
if (obj_size > code_space()->AreaSize()) {
maybe_result = lo_space_->AllocateRaw(obj_size, EXECUTABLE);
} else {
- maybe_result = code_space_->AllocateRaw(obj_size);
+ maybe_result = code_space_->AllocateRaw<FreeList::BEST_FIT>(obj_size);
}
Object* result;
@@ -3879,7 +3882,7 @@ MaybeObject* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
if (new_obj_size > code_space()->AreaSize()) {
maybe_result = lo_space_->AllocateRaw(new_obj_size, EXECUTABLE);
} else {
- maybe_result = code_space_->AllocateRaw(new_obj_size);
+ maybe_result = code_space_->AllocateRaw<FreeList::BEST_FIT>(new_obj_size);
}
Object* result;
@@ -5053,7 +5056,7 @@ MaybeObject* Heap::AllocateInternalizedStringImpl(
Object* result;
{ MaybeObject* maybe_result = (size > Page::kMaxNonCodeHeapObjectSize)
? lo_space_->AllocateRaw(size, NOT_EXECUTABLE)
- : old_data_space_->AllocateRaw(size);
+ : old_data_space_->AllocateRaw<FreeList::BEST_FIT>(size);
if (!maybe_result->ToObject(&result)) return maybe_result;
}
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | src/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698