Changeset 252341 in webkit


Ignore:
Timestamp:
Nov 11, 2019 3:57:40 PM (4 years ago)
Author:
ysuzuki@apple.com
Message:

Unreviewed, fix alignment adjustment when reusing PreciseAllocation
https://bugs.webkit.org/show_bug.cgi?id=201908

  • heap/PreciseAllocation.cpp:

(JSC::PreciseAllocation::reuseForLowerTier):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r252328 r252341  
     12019-11-11  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        Unreviewed, fix alignment adjustment when reusing PreciseAllocation
     4        https://bugs.webkit.org/show_bug.cgi?id=201908
     5
     6        * heap/PreciseAllocation.cpp:
     7        (JSC::PreciseAllocation::reuseForLowerTier):
     8
    192019-11-11  Tuomas Karkkainen  <tuomas.webkit@apple.com>
    210
  • trunk/Source/JavaScriptCore/heap/PreciseAllocation.cpp

    r252302 r252341  
    153153    bool adjustedAlignment = m_adjustedAlignment;
    154154    uint8_t lowerTierIndex = m_lowerTierIndex;
    155 
    156     void* space = this->basePointer();
     155    void* basePointer = this->basePointer();
     156
    157157    this->~PreciseAllocation();
     158
     159    void* space = basePointer;
     160    ASSERT(isAlignedForPreciseAllocation(basePointer) == adjustedAlignment);
     161    if (adjustedAlignment)
     162        space = bitwise_cast<void*>(bitwise_cast<uintptr_t>(basePointer) + halfAlignment);
    158163
    159164    PreciseAllocation* preciseAllocation = new (NotNull, space) PreciseAllocation(heap, size, subspace, 0, adjustedAlignment);
Note: See TracChangeset for help on using the changeset viewer.