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

Unified Diff: src/heap/mark-compact.cc

Issue 1150953002: Generalize HeapObject alignment requirements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments. 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index b4159f2e60f52194bf8b2e883fe09e83671f239d..18bb1ccc4405110d64e9ff14676c75e6d6afce65 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1941,9 +1941,7 @@ int MarkCompactCollector::DiscoverAndEvacuateBlackObjectsOnPage(
continue;
}
- AllocationAlignment alignment = object->NeedsToEnsureDoubleAlignment()
- ? kDoubleAligned
- : kWordAligned;
+ AllocationAlignment alignment = object->RequiredAlignment();
AllocationResult allocation = new_space->AllocateRaw(size, alignment);
if (allocation.IsRetry()) {
if (!new_space->AddFreshPage()) {
@@ -3105,8 +3103,7 @@ bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
OldSpace* old_space = heap()->old_space();
HeapObject* target;
- AllocationAlignment alignment =
- object->NeedsToEnsureDoubleAlignment() ? kDoubleAligned : kWordAligned;
+ AllocationAlignment alignment = object->RequiredAlignment();
AllocationResult allocation = old_space->AllocateRaw(object_size, alignment);
if (allocation.To(&target)) {
MigrateObject(target, object, object_size, old_space->identity());
@@ -3330,10 +3327,7 @@ void MarkCompactCollector::EvacuateLiveObjectsFromPage(Page* p) {
DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object)));
int size = object->Size();
-
- AllocationAlignment alignment = object->NeedsToEnsureDoubleAlignment()
- ? kDoubleAligned
- : kWordAligned;
+ AllocationAlignment alignment = object->RequiredAlignment();
HeapObject* target_object;
AllocationResult allocation = space->AllocateRaw(size, alignment);
if (!allocation.To(&target_object)) {
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698