Fix warnings on ARM and MIPS
authordinfuehr@igalia.com <dinfuehr@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2019 22:40:03 +0000 (22:40 +0000)
committerdinfuehr@igalia.com <dinfuehr@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2019 22:40:03 +0000 (22:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195049

Reviewed by Mark Lam.

.:

Disable warnings for changes to the ABI with GCC 7.1.

* Source/cmake/WebKitCompilerFlags.cmake:

Source/JavaScriptCore:

Fix all warnings on ARM and MIPS.

* assembler/MacroAssemblerPrinter.cpp:
(JSC::Printer::printMemory):
* assembler/testmasm.cpp:
(JSC::testProbeModifiesStackValues):
* bytecode/InByIdStatus.cpp:
(JSC::InByIdStatus::computeFor):
* runtime/CachedTypes.cpp:
(JSC::VariableLengthObject::buffer const):
* runtime/JSBigInt.h:
* tools/JSDollarVM.cpp:
(JSC::codeBlockFromArg):

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

ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssemblerPrinter.cpp
Source/JavaScriptCore/assembler/testmasm.cpp
Source/JavaScriptCore/bytecode/InByIdStatus.cpp
Source/JavaScriptCore/runtime/CachedTypes.cpp
Source/JavaScriptCore/runtime/JSBigInt.h
Source/JavaScriptCore/tools/JSDollarVM.cpp
Source/cmake/WebKitCompilerFlags.cmake

index 06a1e37..952e9d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-02-26  Dominik Infuehr  <dinfuehr@igalia.com>
+
+        Fix warnings on ARM and MIPS
+        https://bugs.webkit.org/show_bug.cgi?id=195049
+
+        Reviewed by Mark Lam.
+
+        Disable warnings for changes to the ABI with GCC 7.1.
+
+        * Source/cmake/WebKitCompilerFlags.cmake:
+
 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
 
         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
index dd196f8..e354e41 100644 (file)
@@ -1,3 +1,24 @@
+2019-02-26  Dominik Infuehr  <dinfuehr@igalia.com>
+
+        Fix warnings on ARM and MIPS
+        https://bugs.webkit.org/show_bug.cgi?id=195049
+
+        Reviewed by Mark Lam.
+
+        Fix all warnings on ARM and MIPS.
+
+        * assembler/MacroAssemblerPrinter.cpp:
+        (JSC::Printer::printMemory):
+        * assembler/testmasm.cpp:
+        (JSC::testProbeModifiesStackValues):
+        * bytecode/InByIdStatus.cpp:
+        (JSC::InByIdStatus::computeFor):
+        * runtime/CachedTypes.cpp:
+        (JSC::VariableLengthObject::buffer const):
+        * runtime/JSBigInt.h:
+        * tools/JSDollarVM.cpp:
+        (JSC::codeBlockFromArg):
+
 2019-02-26  Mark Lam  <mark.lam@apple.com>
 
         Misc cleanup in StructureIDTable after r242096.
index 34019d1..cd36aaf 100644 (file)
@@ -138,17 +138,17 @@ void printMemory(PrintStream& out, Context& context)
             return;
         }
         if (memory.numBytes == sizeof(int16_t)) {
-            auto p = reinterpret_cast<int16_t*>(ptr);
+            auto p = bitwise_cast<int16_t*>(ptr);
             out.printf("%p:<0x%04x %d>", p, *p, *p);
             return;
         }
         if (memory.numBytes == sizeof(int32_t)) {
-            auto p = reinterpret_cast<int32_t*>(ptr);
+            auto p = bitwise_cast<int32_t*>(ptr);
             out.printf("%p:<0x%08x %d>", p, *p, *p);
             return;
         }
         if (memory.numBytes == sizeof(int64_t)) {
-            auto p = reinterpret_cast<int64_t*>(ptr);
+            auto p = bitwise_cast<int64_t*>(ptr);
             out.printf("%p:<0x%016" PRIx64 " %" PRId64 ">", p, *p, *p);
             return;
         }
index 2df019f..99e70a1 100644 (file)
@@ -246,6 +246,7 @@ static Vector<double> doubleOperands()
 }
 
 
+#if CPU(X86) || CPU(X86_64) || CPU(ARM64)
 static Vector<float> floatOperands()
 {
     return Vector<float> {
@@ -263,6 +264,7 @@ static Vector<float> floatOperands()
         -std::numeric_limits<float>::infinity(),
     };
 }
+#endif
 
 static Vector<int32_t> int32Operands()
 {
@@ -779,7 +781,9 @@ void testProbeModifiesStackValues()
     CPUState originalState;
     void* originalSP { nullptr };
     void* newSP { nullptr };
+#if !CPU(MIPS)
     uintptr_t modifiedFlags { 0 };
+#endif
     size_t numberOfExtraEntriesToWrite { 10 }; // ARM64 requires that this be 2 word aligned.
 
 #if CPU(X86) || CPU(X86_64)
index 98e8a9b..5127207 100644 (file)
@@ -58,6 +58,7 @@ InByIdStatus InByIdStatus::computeFor(CodeBlock* profiledBlock, ICStatusMap& map
     UNUSED_PARAM(map);
     UNUSED_PARAM(bytecodeIndex);
     UNUSED_PARAM(uid);
+    UNUSED_PARAM(didExit);
 #endif
 
     return result;
index 9942993..46c9195 100644 (file)
@@ -354,7 +354,7 @@ protected:
     template<typename T>
     const T* buffer() const
     {
-        return reinterpret_cast<const T*>(buffer());
+        return bitwise_cast<const T*>(buffer());
     }
 
     uint8_t* allocate(Encoder& encoder, size_t size)
index dbbf63d..697f23c 100644 (file)
@@ -236,7 +236,7 @@ private:
 
     inline Digit* dataStorage()
     {
-        return reinterpret_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());
+        return bitwise_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());
     }
 
     Digit digit(unsigned);
index 5a5a3cb..12e153c 100644 (file)
@@ -1461,7 +1461,7 @@ static CodeBlock* codeBlockFromArg(ExecState* exec)
             else
                 candidateCodeBlock = func->jsExecutable()->eitherCodeBlock();
         } else
-            candidateCodeBlock = reinterpret_cast<CodeBlock*>(value.asCell());
+            candidateCodeBlock = static_cast<CodeBlock*>(value.asCell());
     }
 
     if (candidateCodeBlock && VMInspector::isValidCodeBlock(exec, candidateCodeBlock))
index ba6f839..1b98a6f 100644 (file)
@@ -131,7 +131,8 @@ if (COMPILER_IS_GCC_OR_CLANG)
     WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Qunused-arguments
                                          -Wno-maybe-uninitialized
                                          -Wno-noexcept-type
-                                         -Wno-parentheses-equality)
+                                         -Wno-parentheses-equality
+                                         -Wno-psabi)
 
     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947
     if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "8.0" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")