Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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:

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


Canonical link: https://commits.webkit.org/209431@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Dominik Infuehr committed Feb 26, 2019
1 parent e6145c2 commit 9ffd38d
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 7 deletions.
11 changes: 11 additions & 0 deletions 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
Expand Down
21 changes: 21 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -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.
Expand Down
6 changes: 3 additions & 3 deletions Source/JavaScriptCore/assembler/MacroAssemblerPrinter.cpp
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions Source/JavaScriptCore/assembler/testmasm.cpp
Expand Up @@ -246,6 +246,7 @@ static Vector<double> doubleOperands()
}


#if CPU(X86) || CPU(X86_64) || CPU(ARM64)
static Vector<float> floatOperands()
{
return Vector<float> {
Expand All @@ -263,6 +264,7 @@ static Vector<float> floatOperands()
-std::numeric_limits<float>::infinity(),
};
}
#endif

static Vector<int32_t> int32Operands()
{
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Source/JavaScriptCore/bytecode/InByIdStatus.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/runtime/CachedTypes.cpp
Expand Up @@ -354,7 +354,7 @@ class VariableLengthObject : public CachedObject<Source> {
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)
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/runtime/JSBigInt.h
Expand Up @@ -236,7 +236,7 @@ class JSBigInt final : public JSCell {

inline Digit* dataStorage()
{
return reinterpret_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());
return bitwise_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());
}

Digit digit(unsigned);
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/tools/JSDollarVM.cpp
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion Source/cmake/WebKitCompilerFlags.cmake
Expand Up @@ -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")
Expand Down

0 comments on commit 9ffd38d

Please sign in to comment.