Changeset 65311 in webkit for trunk/JavaScriptCore/runtime


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/runtime/JSArray.cpp

    r65305 r65311  
    442442    }
    443443
    444     m_storage = reinterpret_cast<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
     444    m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
    445445    m_storage->m_allocBase = baseStorage;
    446446    storage = m_storage;
     
    592592        return false;
    593593
    594     storage = m_storage = reinterpret_cast<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
     594    storage = m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
    595595    m_storage->m_allocBase = baseStorage;
    596596
     
    624624    m_indexBias += newVectorLength - newLength;
    625625   
    626     m_storage = reinterpret_cast<ArrayStorage*>(static_cast<char*>(newBaseStorage) + m_indexBias * sizeof(JSValue));
     626    m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(newBaseStorage) + m_indexBias * sizeof(JSValue));
    627627
    628628    memcpy(m_storage, storage, storageSize(0));
     
    803803            char* newBaseStorage = reinterpret_cast<char*>(storage) + count * sizeof(JSValue);
    804804            memmove(newBaseStorage, storage, storageSize(0));
    805             m_storage = reinterpret_cast<ArrayStorage*>(newBaseStorage);
     805            m_storage = reinterpret_cast_ptr<ArrayStorage*>(newBaseStorage);
    806806
    807807            m_indexBias += count;
     
    840840        char* newBaseStorage = reinterpret_cast<char*>(storage) - count * sizeof(JSValue);
    841841        memmove(newBaseStorage, storage, storageSize(0));
    842         m_storage = reinterpret_cast<ArrayStorage*>(newBaseStorage);
     842        m_storage = reinterpret_cast_ptr<ArrayStorage*>(newBaseStorage);
    843843        m_vectorLength += count;
    844844    } else if (!increaseVectorPrefixLength(m_vectorLength + count)) {
Note: See TracChangeset for help on using the changeset viewer.