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

Unified Diff: src/heap.cc

Issue 35103002: Align double array backing store during compaction and mark-sweep promotion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 7 years 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.h ('k') | src/heap-inl.h » ('j') | no next file with comments »
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 6921bb653f8a97c905fcc0800736c5044e6e38d4..cdf28c0c73e385ced9ad5884b8ffe5bb110e0b50 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2017,28 +2017,6 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
}
-STATIC_ASSERT((FixedDoubleArray::kHeaderSize & kDoubleAlignmentMask) == 0);
-STATIC_ASSERT((ConstantPoolArray::kHeaderSize & kDoubleAlignmentMask) == 0);
-
-
-INLINE(static HeapObject* EnsureDoubleAligned(Heap* heap,
- HeapObject* object,
- int size));
-
-static HeapObject* EnsureDoubleAligned(Heap* heap,
- HeapObject* object,
- int size) {
- if ((OffsetFrom(object->address()) & kDoubleAlignmentMask) != 0) {
- heap->CreateFillerObjectAt(object->address(), kPointerSize);
- return HeapObject::FromAddress(object->address() + kPointerSize);
- } else {
- heap->CreateFillerObjectAt(object->address() + size - kPointerSize,
- kPointerSize);
- return object;
- }
-}
-
-
enum LoggingAndProfiling {
LOGGING_AND_PROFILING_ENABLED,
LOGGING_AND_PROFILING_DISABLED
@@ -2217,7 +2195,7 @@ class ScavengingVisitor : public StaticVisitorBase {
HeapObject* target = HeapObject::cast(result);
if (alignment != kObjectAlignment) {
- target = EnsureDoubleAligned(heap, target, allocation_size);
+ target = heap->EnsureDoubleAligned(target, allocation_size);
}
// Order is important: slot might be inside of the target if target
@@ -2246,7 +2224,7 @@ class ScavengingVisitor : public StaticVisitorBase {
HeapObject* target = HeapObject::cast(result);
if (alignment != kObjectAlignment) {
- target = EnsureDoubleAligned(heap, target, allocation_size);
+ target = heap->EnsureDoubleAligned(target, allocation_size);
}
// Order is important: slot might be inside of the target if target
@@ -5453,7 +5431,7 @@ MaybeObject* Heap::AllocateRawFixedDoubleArray(int length,
if (!maybe_object->To<HeapObject>(&object)) return maybe_object;
}
- return EnsureDoubleAligned(this, object, size);
+ return EnsureDoubleAligned(object, size);
}
@@ -5474,7 +5452,7 @@ MaybeObject* Heap::AllocateConstantPoolArray(int number_of_int64_entries,
{ MaybeObject* maybe_object = AllocateRaw(size, space, OLD_POINTER_SPACE);
if (!maybe_object->To<HeapObject>(&object)) return maybe_object;
}
- object = EnsureDoubleAligned(this, object, size);
+ object = EnsureDoubleAligned(object, size);
HeapObject::cast(object)->set_map_no_write_barrier(constant_pool_array_map());
ConstantPoolArray* constant_pool =
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698