Changeset 64302 in webkit for trunk/JavaScriptCore/assembler


Ignore:
Timestamp:
Jul 29, 2010, 12:52:22 PM (15 years ago)
Author:
Csaba Osztrogonác
Message:

2010-07-29 Gabor Loki <[email protected]>

Reviewed by Gavin Barraclough.

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

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.

  • assembler/ARMAssembler.cpp: (JSC::ARMAssembler::executableCopy):
  • assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::putShortUnchecked): (JSC::AssemblerBuffer::putIntUnchecked): (JSC::AssemblerBuffer::putInt64Unchecked):
  • jit/JITStubs.cpp:
  • pcre/pcre_compile.cpp: (jsRegExpCompile):
  • wtf/FastMalloc.cpp: (WTF::PageHeapAllocator::New): (WTF::TCMalloc_Central_FreeList::Populate):
  • wtf/MD5.cpp: (WTF::reverseBytes): (WTF::MD5::addBytes): (WTF::MD5::checksum):
  • wtf/StdLibExtras.h: (reinterpret_cast_ptr):
  • wtf/Vector.h: (WTF::VectorBuffer::inlineBuffer):
  • wtf/qt/StringQt.cpp: (WebCore::String::String):
Location:
trunk/JavaScriptCore/assembler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/ARMAssembler.cpp

    r63228 r64302  
    356356        // The last bit is set if the constant must be placed on constant pool.
    357357        int pos = (*iter) & (~0x1);
    358         ARMWord* ldrAddr = reinterpret_cast<ARMWord*>(data + pos);
     358        ARMWord* ldrAddr = reinterpret_cast_ptr<ARMWord*>(data + pos);
    359359        ARMWord* addr = getLdrImmAddress(ldrAddr);
    360360        if (*addr != InvalidBranchTarget) {
    361361            if (!(*iter & 1)) {
    362                 int diff = reinterpret_cast<ARMWord*>(data + *addr) - (ldrAddr + DefaultPrefetching);
     362                int diff = reinterpret_cast_ptr<ARMWord*>(data + *addr) - (ldrAddr + DefaultPrefetching);
    363363
    364364                if ((diff <= BOFFSET_MAX && diff >= BOFFSET_MIN)) {
  • trunk/JavaScriptCore/assembler/AssemblerBuffer.h

    r61851 r64302  
    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.