From: plind44@gmail.com Date: Sun, 17 Nov 2013 17:23:58 +0000 (+0000) Subject: MIPS: Ensure double aligned allocations through runtime routines. X-Git-Tag: upstream/4.7.83~11705 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e7084ebcf17843a13020b9cd88e3e76f5a2e5c4;p=platform%2Fupstream%2Fv8.git MIPS: Ensure double aligned allocations through runtime routines. 3rd (of 3) CLs to ensure complete alignment of FixedDoubleArrays. TEST= BUG= R=mstarzinger@chromium.org, plind44@gmail.com Review URL: https://codereview.chromium.org/35313002 Patch from Dusan Milosavljevic . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17809 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/runtime.cc b/src/runtime.cc index 28506dd..1001fe2 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -9786,6 +9786,7 @@ static MaybeObject* Allocate(Isolate* isolate, bool double_align, AllocationSpace space) { Heap* heap = isolate->heap(); + if (double_align) size += kPointerSize; RUNTIME_ASSERT(IsAligned(size, kPointerSize)); RUNTIME_ASSERT(size > 0); RUNTIME_ASSERT(size <= heap->MaxRegularSpaceAllocationSize()); @@ -9797,6 +9798,9 @@ static MaybeObject* Allocate(Isolate* isolate, MemoryChunk* chunk = MemoryChunk::FromAddress(allocation->address()); ASSERT(chunk->owner()->identity() == space); #endif + if (double_align) { + allocation = heap->EnsureDoubleAligned(allocation, size); + } heap->CreateFillerObjectAt(allocation->address(), size); return allocation; }