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

Unified Diff: src/heap/heap-inl.h

Issue 1138643005: Clean-up aligned allocation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index 13235b25d417337a9f339a8e4502cd4fd896c60d..0f2d0f22a3e302f48ef8deb8fa0c15c7930645c7 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -173,15 +173,7 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
HeapObject* object;
AllocationResult allocation;
if (NEW_SPACE == space) {
-#ifndef V8_HOST_ARCH_64_BIT
- if (alignment == kWordAligned) {
- allocation = new_space_.AllocateRaw(size_in_bytes);
- } else {
- allocation = new_space_.AllocateRawAligned(size_in_bytes, alignment);
- }
-#else
- allocation = new_space_.AllocateRaw(size_in_bytes);
-#endif
+ allocation = new_space_.AllocateRaw(size_in_bytes, alignment);
if (always_allocate() && allocation.IsRetry() && retry_space != NEW_SPACE) {
space = retry_space;
} else {
@@ -193,18 +185,10 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
}
if (OLD_SPACE == space) {
-#ifndef V8_HOST_ARCH_64_BIT
- if (alignment == kWordAligned) {
- allocation = old_space_->AllocateRaw(size_in_bytes);
- } else {
- allocation = old_space_->AllocateRawAligned(size_in_bytes, alignment);
- }
-#else
- allocation = old_space_->AllocateRaw(size_in_bytes);
-#endif
+ allocation = old_space_->AllocateRaw(size_in_bytes, alignment);
} else if (CODE_SPACE == space) {
if (size_in_bytes <= code_space()->AreaSize()) {
- allocation = code_space_->AllocateRaw(size_in_bytes);
+ allocation = code_space_->AllocateRawUnaligned(size_in_bytes);
} else {
// Large code objects are allocated in large object space.
allocation = lo_space_->AllocateRaw(size_in_bytes, EXECUTABLE);
@@ -213,7 +197,7 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
allocation = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE);
} else {
DCHECK(MAP_SPACE == space);
- allocation = map_space_->AllocateRaw(size_in_bytes);
+ allocation = map_space_->AllocateRawUnaligned(size_in_bytes);
}
if (allocation.To(&object)) {
OnAllocationEvent(object, size_in_bytes);
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698