Changeset 106686 in webkit for trunk/Source/JavaScriptCore/heap


Ignore:
Timestamp:
Feb 3, 2012, 12:59:00 PM (13 years ago)
Author:
[email protected]
Message:

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

Patch by Rob Buis <[email protected]> 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/heap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.