Ignore:
Timestamp:
Aug 13, 2010, 3:14:36 AM (15 years ago)
Author:
[email protected]
Message:

Avoid increasing required alignment of target type warning on ARM
https://bugs.webkit.org/show_bug.cgi?id=38045

Reviewed by Gavin Barraclough.

The reinterpret_cast<Type1*>([pointer to Type2]) expressions - where
sizeof(Type1) > sizeof(Type2) - cause the following warning on ARM:
increases required alignment of target type warnings.
Casting the type of [pointer to Type2] object to void* bypasses the
warning.

(JSC::ARMAssembler::executableCopy):

(JSC::AssemblerBuffer::putShortUnchecked):
(JSC::AssemblerBuffer::putIntUnchecked):
(JSC::AssemblerBuffer::putInt64Unchecked):

(JSC::RegisterFile::RegisterFile):
(JSC::RegisterFile::grow):

(jsRegExpCompile):

(JSC::JSArray::putSlowCase):
(JSC::JSArray::increaseVectorLength):
(JSC::JSArray::increaseVectorPrefixLength):
(JSC::JSArray::shiftCount):
(JSC::JSArray::unshiftCount):

(WTF::PageHeapAllocator::New):
(WTF::TCMalloc_Central_FreeList::Populate):

  • wtf/MD5.cpp:

(WTF::reverseBytes):
(WTF::MD5::addBytes):
(WTF::MD5::checksum):

(isPointerTypeAlignmentOkay):
(reinterpret_cast_ptr):

(WTF::VectorBuffer::inlineBuffer):

(WTF::String::String):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/AssemblerBuffer.h

    r64327 r65311  
    3434#include <wtf/Assertions.h>
    3535#include <wtf/FastMalloc.h>
     36#include <wtf/StdLibExtras.h>
    3637
    3738namespace JSC {
     
    8283        {
    8384            ASSERT(!(m_size > m_capacity - 4));
    84             *reinterpret_cast<short*>(&m_buffer[m_size]) = value;
     85            *reinterpret_cast_ptr<short*>(&m_buffer[m_size]) = value;
    8586            m_size += 2;
    8687        }
     
    9697        {
    9798            ASSERT(!(m_size > m_capacity - 4));
    98             *reinterpret_cast<int*>(&m_buffer[m_size]) = value;
     99            *reinterpret_cast_ptr<int*>(&m_buffer[m_size]) = value;
    99100            m_size += 4;
    100101        }
     
    103104        {
    104105            ASSERT(!(m_size > m_capacity - 8));
    105             *reinterpret_cast<int64_t*>(&m_buffer[m_size]) = value;
     106            *reinterpret_cast_ptr<int64_t*>(&m_buffer[m_size]) = value;
    106107            m_size += 8;
    107108        }
Note: See TracChangeset for help on using the changeset viewer.