Ignore:
Timestamp:
Feb 22, 2012, 2:26:22 PM (13 years ago)
Author:
[email protected]
Message:

Allocations from CopiedBlocks should always be 8-byte aligned
https://bugs.webkit.org/show_bug.cgi?id=79271

Reviewed by Geoffrey Garen.

  • heap/CopiedAllocator.h:

(JSC::CopiedAllocator::allocate):

  • heap/CopiedBlock.h: Changed to add padding so that the start of the payload is always

guaranteed to be 8 byte aligned on both 64- and 32-bit platforms.
(CopiedBlock):

  • heap/CopiedSpace.cpp: Changed all assertions of isPointerAligned to is8ByteAligned.

(JSC::CopiedSpace::tryAllocateOversize):
(JSC::CopiedSpace::getFreshBlock):

  • heap/CopiedSpaceInlineMethods.h:

(JSC::CopiedSpace::allocateFromBlock):

  • runtime/JSArray.h:

(ArrayStorage): Added padding for ArrayStorage to make sure that it is always 8 byte
aligned on both 64- and 32-bit platforms.

  • wtf/StdLibExtras.h:

(WTF::is8ByteAligned): Added new utility function that functions similarly to the
way isPointerAligned does, but it just always checks for 8 byte alignment.
(WTF):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/StdLibExtras.h

    r105442 r108553  
    115115}
    116116
     117inline bool is8ByteAligned(void* p)
     118{
     119    return !((uintptr_t)(p) & (sizeof(double) - 1));
     120}
     121
    117122/*
    118123 * C++'s idea of a reinterpret_cast lacks sufficient cojones.
     
    293298using WTF::KB;
    294299using WTF::isPointerAligned;
     300using WTF::is8ByteAligned;
    295301using WTF::binarySearch;
    296302using WTF::bitwise_cast;
Note: See TracChangeset for help on using the changeset viewer.