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

Unified Diff: src/spaces-inl.h

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 | « src/spaces.cc ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces-inl.h
diff --git a/src/spaces-inl.h b/src/spaces-inl.h
index 77117b8a4e4a9d960ad605f197cd623e888c5e47..36aa91ed04ece8c7020c28acb5cde18d7db21d01 100644
--- a/src/spaces-inl.h
+++ b/src/spaces-inl.h
@@ -272,7 +272,16 @@ HeapObject* PagedSpace::AllocateLinearly(int size_in_bytes) {
}
-// Raw allocation.
+template MaybeObject* PagedSpace::
+ AllocateRaw<FreeList::BEST_FIT>(int size_in_bytes);
+
+
+template MaybeObject* PagedSpace::
+ AllocateRaw<FreeList::WORST_FIT>(int size_in_bytes);
+
+
+// Raw allocation
+template<FreeList::AllocationStrategy strategy>
MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
HeapObject* object = AllocateLinearly(size_in_bytes);
if (object != NULL) {
@@ -286,7 +295,7 @@ MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
(anchor_.next_chunk() == &anchor_ &&
anchor_.prev_chunk() == &anchor_));
- object = free_list_.Allocate(size_in_bytes);
+ object = free_list_.Allocate<strategy>(size_in_bytes);
if (object != NULL) {
if (identity() == CODE_SPACE) {
SkipList::Update(object->address(), size_in_bytes);
@@ -294,7 +303,7 @@ MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes) {
return object;
}
- object = SlowAllocateRaw(size_in_bytes);
+ object = SlowAllocateRaw<strategy>(size_in_bytes);
if (object != NULL) {
if (identity() == CODE_SPACE) {
SkipList::Update(object->address(), size_in_bytes);
« no previous file with comments | « src/spaces.cc ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698