Commit 8b0d7312 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9c02385c
2012-02-03 Rob Buis <rbuis@rim.com>
Fix alignment warnings in ARMv7
https://bugs.webkit.org/show_bug.cgi?id=55368
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):
2012-02-03 Mark Hahnenberg <mhahnenberg@apple.com>
 
Build fix
......@@ -35,7 +35,7 @@ typedef JSValue* HandleSlot;
template<typename T> struct HandleTypes {
typedef T* ExternalType;
static ExternalType getFromSlot(HandleSlot slot) { return (slot && *slot) ? reinterpret_cast<ExternalType>(slot->asCell()) : 0; }
static ExternalType getFromSlot(HandleSlot slot) { return (slot && *slot) ? reinterpret_cast<ExternalType>(static_cast<void*>(slot->asCell())) : 0; }
static JSValue toJSValue(T* cell) { return reinterpret_cast<JSCell*>(cell); }
template<typename U> static void validateUpcast() { T* temp; temp = (U*)0; }
};
......
......@@ -89,7 +89,7 @@ MarkedBlock::FreeCell* MarkedBlock::specializedSweep()
if (blockState == Marked && m_marks.get(i))
continue;
JSCell* cell = reinterpret_cast<JSCell*>(&atoms()[i]);
JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
if (blockState == Zapped && !cell->isZapped())
continue;
......
......@@ -317,7 +317,7 @@ namespace JSC {
template <typename Functor> inline void MarkedBlock::forEachCell(Functor& functor)
{
for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
JSCell* cell = reinterpret_cast<JSCell*>(&atoms()[i]);
JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
if (!isLive(cell))
continue;
......
......@@ -93,7 +93,7 @@ public:
{
if (m_cell)
validateCell(m_cell);
return reinterpret_cast<T*>(m_cell);
return reinterpret_cast<T*>(static_cast<void*>(m_cell));
}
T* operator*() const
......@@ -128,7 +128,7 @@ public:
}
#if ENABLE(GC_VALIDATION)
T* unvalidatedGet() const { return reinterpret_cast<T*>(m_cell); }
T* unvalidatedGet() const { return reinterpret_cast<T*>(static_cast<void*>(m_cell)); }
#endif
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment