Changeset 106686 in webkit


Ignore:
Timestamp:
Feb 3, 2012 12:59:00 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Fix alignment warnings in ARMv7
https://bugs.webkit.org/show_bug.cgi?id=55368

Patch by Rob Buis <rbuis@rim.com> on 2012-02-03
Reviewed by Filip Pizlo.

Use reinterpret_cast_ptr and static_cast to get rid of alignment issues in ARMv7 code.

  • heap/HandleTypes.h:

(JSC::HandleTypes::getFromSlot):

  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::specializedSweep):

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::forEachCell):

  • runtime/WriteBarrier.h:

(JSC::WriteBarrierBase::get):
(JSC::WriteBarrierBase::unvalidatedGet):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r106677 r106686  
     12012-02-03  Rob Buis  <rbuis@rim.com>
     2
     3        Fix alignment warnings in ARMv7
     4        https://bugs.webkit.org/show_bug.cgi?id=55368
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Use reinterpret_cast_ptr and static_cast to get rid of alignment issues in ARMv7 code.
     9
     10        * heap/HandleTypes.h:
     11        (JSC::HandleTypes::getFromSlot):
     12        * heap/MarkedBlock.cpp:
     13        (JSC::MarkedBlock::specializedSweep):
     14        * heap/MarkedBlock.h:
     15        (JSC::MarkedBlock::forEachCell):
     16        * runtime/WriteBarrier.h:
     17        (JSC::WriteBarrierBase::get):
     18        (JSC::WriteBarrierBase::unvalidatedGet):
     19
    1202012-02-03  Mark Hahnenberg  <mhahnenberg@apple.com>
    221
  • trunk/Source/JavaScriptCore/heap/HandleTypes.h

    r95901 r106686  
    3636template<typename T> struct HandleTypes {
    3737    typedef T* ExternalType;
    38     static ExternalType getFromSlot(HandleSlot slot) { return (slot && *slot) ? reinterpret_cast<ExternalType>(slot->asCell()) : 0; }
     38    static ExternalType getFromSlot(HandleSlot slot) { return (slot && *slot) ? reinterpret_cast<ExternalType>(static_cast<void*>(slot->asCell())) : 0; }
    3939    static JSValue toJSValue(T* cell) { return reinterpret_cast<JSCell*>(cell); }
    4040    template<typename U> static void validateUpcast() { T* temp; temp = (U*)0; }
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r105442 r106686  
    9090            continue;
    9191
    92         JSCell* cell = reinterpret_cast<JSCell*>(&atoms()[i]);
     92        JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
    9393        if (blockState == Zapped && !cell->isZapped())
    9494            continue;
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.h

    r105442 r106686  
    318318    {
    319319        for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
    320             JSCell* cell = reinterpret_cast<JSCell*>(&atoms()[i]);
     320            JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
    321321            if (!isLive(cell))
    322322                continue;
  • trunk/Source/JavaScriptCore/runtime/WriteBarrier.h

    r104900 r106686  
    9494        if (m_cell)
    9595            validateCell(m_cell);
    96         return reinterpret_cast<T*>(m_cell);
     96        return reinterpret_cast<T*>(static_cast<void*>(m_cell));
    9797    }
    9898
     
    129129
    130130#if ENABLE(GC_VALIDATION)
    131     T* unvalidatedGet() const { return reinterpret_cast<T*>(m_cell); }
     131    T* unvalidatedGet() const { return reinterpret_cast<T*>(static_cast<void*>(m_cell)); }
    132132#endif
    133133
Note: See TracChangeset for help on using the changeset viewer.