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

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

Issue 1128323003: Remove explicit double alignment from allocation helper functions. (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') | no next file » | 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 38deb1f31df4c49b8325dd79a04e4ce813116e72..d0078c879f91a0531ebb52a401bf9a5808c99a40 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -156,7 +156,8 @@ AllocationResult Heap::CopyConstantPoolArray(ConstantPoolArray* src) {
AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
- AllocationSpace retry_space) {
+ AllocationSpace retry_space,
+ Alignment alignment) {
DCHECK(AllowHandleAllocation::IsAllowed());
DCHECK(AllowHeapAllocation::IsAllowed());
DCHECK(gc_state_ == NOT_IN_GC);
@@ -172,7 +173,15 @@ 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 == kDoubleAligned) {
+ allocation = new_space_.AllocateRawDoubleAligned(size_in_bytes);
+ } else {
+ allocation = new_space_.AllocateRaw(size_in_bytes);
+ }
+#else
allocation = new_space_.AllocateRaw(size_in_bytes);
+#endif
if (always_allocate() && allocation.IsRetry() && retry_space != NEW_SPACE) {
space = retry_space;
} else {
@@ -184,7 +193,15 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
}
if (OLD_SPACE == space) {
+#ifndef V8_HOST_ARCH_64_BIT
+ if (alignment == kDoubleAligned) {
+ allocation = old_space_->AllocateRawDoubleAligned(size_in_bytes);
+ } else {
+ allocation = old_space_->AllocateRaw(size_in_bytes);
+ }
+#else
allocation = old_space_->AllocateRaw(size_in_bytes);
+#endif
} else if (CODE_SPACE == space) {
if (size_in_bytes <= code_space()->AreaSize()) {
allocation = code_space_->AllocateRaw(size_in_bytes);
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698