[BlackBerry][ARM] Fix cast-align warnings in JavaScriptCore
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Feb 2013 13:13:43 +0000 (13:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Feb 2013 13:13:43 +0000 (13:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110738

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-02-25
Reviewed by Rob Buis.

Use reinterpret_cast_ptr instead of reinterpret_cast for
pointers.

* dfg/DFGOperations.cpp:
* heap/CopiedBlock.h:
(JSC::CopiedBlock::zeroFillWilderness):
* heap/WeakBlock.h:
(JSC::WeakBlock::asWeakImpl):
(JSC::WeakBlock::asFreeCell):
(JSC::WeakBlock::weakImpls):
* heap/WeakImpl.h:
(JSC::WeakImpl::asWeakImpl):
* interpreter/JSStack.cpp:
(JSC::JSStack::disableErrorStackReserve):
* interpreter/JSStack.h:
(JSC::JSStack::reservationEnd):
* runtime/ArrayStorage.h:
(JSC::ArrayStorage::from):
* runtime/Butterfly.h:
(JSC::Butterfly::indexingPayload):
* runtime/IndexingHeader.h:
(JSC::IndexingHeader::propertyStorage):
* runtime/JSActivation.h:
(JSC::JSActivation::tearOff):
(JSC::JSActivation::isTornOff):
(JSC::JSActivation::storage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143909 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/heap/CopiedBlock.h
Source/JavaScriptCore/heap/WeakBlock.h
Source/JavaScriptCore/heap/WeakImpl.h
Source/JavaScriptCore/interpreter/JSStack.cpp
Source/JavaScriptCore/interpreter/JSStack.h
Source/JavaScriptCore/runtime/ArrayStorage.h
Source/JavaScriptCore/runtime/Butterfly.h
Source/JavaScriptCore/runtime/IndexingHeader.h
Source/JavaScriptCore/runtime/JSActivation.h

index 2dee194..0bfe682 100644 (file)
@@ -1,3 +1,37 @@
+2013-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [BlackBerry][ARM] Fix cast-align warnings in JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=110738
+
+        Reviewed by Rob Buis.
+
+        Use reinterpret_cast_ptr instead of reinterpret_cast for
+        pointers.
+
+        * dfg/DFGOperations.cpp:
+        * heap/CopiedBlock.h:
+        (JSC::CopiedBlock::zeroFillWilderness):
+        * heap/WeakBlock.h:
+        (JSC::WeakBlock::asWeakImpl):
+        (JSC::WeakBlock::asFreeCell):
+        (JSC::WeakBlock::weakImpls):
+        * heap/WeakImpl.h:
+        (JSC::WeakImpl::asWeakImpl):
+        * interpreter/JSStack.cpp:
+        (JSC::JSStack::disableErrorStackReserve):
+        * interpreter/JSStack.h:
+        (JSC::JSStack::reservationEnd):
+        * runtime/ArrayStorage.h:
+        (JSC::ArrayStorage::from):
+        * runtime/Butterfly.h:
+        (JSC::Butterfly::indexingPayload):
+        * runtime/IndexingHeader.h:
+        (JSC::IndexingHeader::propertyStorage):
+        * runtime/JSActivation.h:
+        (JSC::JSActivation::tearOff):
+        (JSC::JSActivation::isTornOff):
+        (JSC::JSActivation::storage):
+
 2013-02-22  Filip Pizlo  <fpizlo@apple.com>
 
         DFG::SpeculativeJIT::speculateNumber() should just use SpeculateDoubleOperand instead of doing its own thing
index 9216908..4ccb911 100644 (file)
@@ -1622,7 +1622,7 @@ void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void*
     char* scratchPointer = static_cast<char*>(scratch);
     for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i) {
         GPRReg gpr = GPRInfo::toRegister(i);
-        dataLog(" ", GPRInfo::debugName(gpr), ":", RawPointer(*reinterpret_cast<void**>(scratchPointer)));
+        dataLog(" ", GPRInfo::debugName(gpr), ":", RawPointer(*reinterpret_cast_ptr<void**>(scratchPointer)));
         scratchPointer += sizeof(EncodedJSValue);
     }
     dataLog("\n");
@@ -1630,8 +1630,8 @@ void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void*
     for (unsigned i = 0; i < FPRInfo::numberOfRegisters; ++i) {
         FPRReg fpr = FPRInfo::toRegister(i);
         dataLog(" ", FPRInfo::debugName(fpr), ":");
-        uint64_t bits = *reinterpret_cast<uint64_t*>(scratchPointer);
-        double value = *reinterpret_cast<double*>(scratchPointer);
+        uint64_t bits = *reinterpret_cast_ptr<uint64_t*>(scratchPointer);
+        double value = *reinterpret_cast_ptr<double*>(scratchPointer);
         dataLogF("%llx:%lf", static_cast<long long>(bits), value);
         scratchPointer += sizeof(EncodedJSValue);
     }
index 66083a6..86cca8c 100644 (file)
@@ -116,7 +116,7 @@ inline void CopiedBlock::zeroFillWilderness()
 #else
     JSValue emptyValue;
     JSValue* limit = reinterpret_cast_ptr<JSValue*>(wildernessEnd());
-    for (JSValue* currentValue = reinterpret_cast<JSValue*>(wilderness()); currentValue < limit; currentValue++)
+    for (JSValue* currentValue = reinterpret_cast_ptr<JSValue*>(wilderness()); currentValue < limit; currentValue++)
         *currentValue = emptyValue;
 #endif
 }
index fd28101..b6b631e 100644 (file)
@@ -97,7 +97,7 @@ inline bool WeakBlock::SweepResult::isNull() const
 
 inline WeakImpl* WeakBlock::asWeakImpl(FreeCell* freeCell)
 {
-    return reinterpret_cast<WeakImpl*>(freeCell);
+    return reinterpret_cast_ptr<WeakImpl*>(freeCell);
 }
 
 inline WeakBlock::SweepResult WeakBlock::takeSweepResult()
@@ -110,12 +110,12 @@ inline WeakBlock::SweepResult WeakBlock::takeSweepResult()
 
 inline WeakBlock::FreeCell* WeakBlock::asFreeCell(WeakImpl* weakImpl)
 {
-    return reinterpret_cast<FreeCell*>(weakImpl);
+    return reinterpret_cast_ptr<FreeCell*>(weakImpl);
 }
 
 inline WeakImpl* WeakBlock::weakImpls()
 {
-    return reinterpret_cast<WeakImpl*>(this) + ((sizeof(WeakBlock) + sizeof(WeakImpl) - 1) / sizeof(WeakImpl));
+    return reinterpret_cast_ptr<WeakImpl*>(this) + ((sizeof(WeakBlock) + sizeof(WeakImpl) - 1) / sizeof(WeakImpl));
 }
 
 inline size_t WeakBlock::weakImplCount()
index 9e38aa5..ca93fb2 100644 (file)
@@ -107,7 +107,7 @@ inline void* WeakImpl::context()
 
 inline WeakImpl* WeakImpl::asWeakImpl(JSValue* slot)
 {
-    return reinterpret_cast<WeakImpl*>(reinterpret_cast<char*>(slot) + OBJECT_OFFSETOF(WeakImpl, m_jsValue));
+    return reinterpret_cast_ptr<WeakImpl*>(reinterpret_cast_ptr<char*>(slot) + OBJECT_OFFSETOF(WeakImpl, m_jsValue));
 }
 
 } // namespace JSC
index f5f9e37..1224e14 100644 (file)
@@ -135,7 +135,7 @@ void JSStack::enableErrorStackReserve()
 void JSStack::disableErrorStackReserve()
 {
     char* useableEnd = reinterpret_cast<char*>(reservationEnd()) - commitSize;
-    m_useableEnd = reinterpret_cast<Register*>(useableEnd);
+    m_useableEnd = reinterpret_cast_ptr<Register*>(useableEnd);
 
     // By the time we get here, we are guaranteed to be destructing the last
     // Interpreter::ErrorHandlingMode that enabled this reserve in the first
index 3beb59e..b71eeef 100644 (file)
@@ -113,7 +113,7 @@ namespace JSC {
         {
             char* base = static_cast<char*>(m_reservation.base());
             char* reservationEnd = base + m_reservation.size();
-            return reinterpret_cast<Register*>(reservationEnd);
+            return reinterpret_cast_ptr<Register*>(reservationEnd);
         }
 
 #if ENABLE(DEBUG_JSSTACK)
index c2a2d8a..a0287c9 100644 (file)
@@ -49,7 +49,7 @@ private:
     ArrayStorage() { } // Not directly instantiable. Can only be created as part of a Butterfly.
 public:
     
-    static ArrayStorage* from(Butterfly* butterfly) { return reinterpret_cast<ArrayStorage*>(butterfly); }
+    static ArrayStorage* from(Butterfly* butterfly) { return reinterpret_cast_ptr<ArrayStorage*>(butterfly); }
     static ArrayStorage* from(IndexingHeader* indexingHeader) { return indexingHeader->arrayStorage(); }
     
     Butterfly* butterfly() { return reinterpret_cast<Butterfly*>(this); }
index 1327732..953ebc5 100644 (file)
@@ -121,7 +121,7 @@ public:
     void setVectorLength(uint32_t value) { indexingHeader()->setVectorLength(value); }
     
     template<typename T>
-    T* indexingPayload() { return reinterpret_cast<T*>(this); }
+    T* indexingPayload() { return reinterpret_cast_ptr<T*>(this); }
     ArrayStorage* arrayStorage() { return indexingPayload<ArrayStorage>(); }
     ContiguousJSValues contiguousInt32() { return ContiguousJSValues(indexingPayload<WriteBarrier<Unknown> >(), vectorLength()); }
 
index bd0d96a..cee0762 100644 (file)
@@ -86,12 +86,12 @@ public:
     
     PropertyStorage propertyStorage()
     {
-        return reinterpret_cast<PropertyStorage>(this);
+        return reinterpret_cast_ptr<PropertyStorage>(this);
     }
     
     ConstPropertyStorage propertyStorage() const
     {
-        return reinterpret_cast<ConstPropertyStorage>(this);
+        return reinterpret_cast_ptr<ConstPropertyStorage>(this);
     }
     
     ArrayStorage* arrayStorage()
index b8f5621..a38a8c4 100644 (file)
@@ -153,7 +153,7 @@ namespace JSC {
     {
         ASSERT(!isTornOff());
 
-        WriteBarrierBase<Unknown>* dst = reinterpret_cast<WriteBarrierBase<Unknown>*>(
+        WriteBarrierBase<Unknown>* dst = reinterpret_cast_ptr<WriteBarrierBase<Unknown>*>(
             reinterpret_cast<char*>(this) + registersOffset(symbolTable()));
         WriteBarrierBase<Unknown>* src = m_registers;
 
@@ -167,7 +167,7 @@ namespace JSC {
 
     inline bool JSActivation::isTornOff()
     {
-        return m_registers == reinterpret_cast<WriteBarrierBase<Unknown>*>(
+        return m_registers == reinterpret_cast_ptr<WriteBarrierBase<Unknown>*>(
             reinterpret_cast<char*>(this) + registersOffset(symbolTable()));
     }
 
@@ -178,7 +178,7 @@ namespace JSC {
 
     inline WriteBarrier<Unknown>* JSActivation::storage()
     {
-        return reinterpret_cast<WriteBarrier<Unknown>*>(
+        return reinterpret_cast_ptr<WriteBarrier<Unknown>*>(
             reinterpret_cast<char*>(this) + storageOffset());
     }