Title: [210769] trunk/Source
- Revision
- 210769
- Author
- [email protected]
- Date
- 2017-01-14 11:35:23 -0800 (Sat, 14 Jan 2017)
Log Message
WebAssembly: Suppress warnings & errors in GCC
https://bugs.webkit.org/show_bug.cgi?id=167049
Reviewed by Sam Weinig.
Source/_javascript_Core:
* wasm/WasmFunctionParser.h:
Add missing { } after the switch. Ideally, it is not necessary.
But in GCC, it is required. Since this function is fairly large,
I think the code generated by this does not cause performance
regression.
* wasm/WasmPageCount.h:
UINT_MAX is defined in limits.h.
* wasm/generateWasmValidateInlinesHeader.py:
On the other hand, we use this suppress pragma here to solve the
same problem in wasm/WasmFunctionParser.h. Since the load function
is fairly small, the additional `return { };` may generate some
suboptimal code. See bug 150794 for more detail.
Source/WTF:
* wtf/LEBDecoder.h:
(WTF::LEBDecoder::decodeInt):
If T = int, it performs `-1 << shift`. It causes
warning in GCC. Instead, we first cast it to the
UnsignedT, perform operation and re-cast to the
T.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (210768 => 210769)
--- trunk/Source/_javascript_Core/ChangeLog 2017-01-14 18:45:20 UTC (rev 210768)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-01-14 19:35:23 UTC (rev 210769)
@@ -1,5 +1,27 @@
2017-01-14 Yusuke Suzuki <[email protected]>
+ WebAssembly: Suppress warnings & errors in GCC
+ https://bugs.webkit.org/show_bug.cgi?id=167049
+
+ Reviewed by Sam Weinig.
+
+ * wasm/WasmFunctionParser.h:
+ Add missing { } after the switch. Ideally, it is not necessary.
+ But in GCC, it is required. Since this function is fairly large,
+ I think the code generated by this does not cause performance
+ regression.
+
+ * wasm/WasmPageCount.h:
+ UINT_MAX is defined in limits.h.
+
+ * wasm/generateWasmValidateInlinesHeader.py:
+ On the other hand, we use this suppress pragma here to solve the
+ same problem in wasm/WasmFunctionParser.h. Since the load function
+ is fairly small, the additional `return { };` may generate some
+ suboptimal code. See bug 150794 for more detail.
+
+2017-01-14 Yusuke Suzuki <[email protected]>
+
Reserve capacity for StringBuilder in unescape
https://bugs.webkit.org/show_bug.cgi?id=167008
Modified: trunk/Source/_javascript_Core/wasm/WasmFunctionParser.h (210768 => 210769)
--- trunk/Source/_javascript_Core/wasm/WasmFunctionParser.h 2017-01-14 18:45:20 UTC (rev 210768)
+++ trunk/Source/_javascript_Core/wasm/WasmFunctionParser.h 2017-01-14 19:35:23 UTC (rev 210769)
@@ -327,7 +327,7 @@
if (result != Context::emptyExpression)
m_expressionStack.append(result);
- return { };
+ return { };
}
case CallIndirect: {
@@ -511,6 +511,7 @@
}
ASSERT_NOT_REACHED();
+ return { };
}
// FIXME: We should try to use the same decoder function for both unreachable and reachable code. https://bugs.webkit.org/show_bug.cgi?id=165965
Modified: trunk/Source/_javascript_Core/wasm/WasmPageCount.h (210768 => 210769)
--- trunk/Source/_javascript_Core/wasm/WasmPageCount.h 2017-01-14 18:45:20 UTC (rev 210768)
+++ trunk/Source/_javascript_Core/wasm/WasmPageCount.h 2017-01-14 19:35:23 UTC (rev 210769)
@@ -27,6 +27,8 @@
#if ENABLE(WEBASSEMBLY)
+#include <limits.h>
+
namespace WTF {
class PrintStream;
}
Modified: trunk/Source/_javascript_Core/wasm/generateWasmValidateInlinesHeader.py (210768 => 210769)
--- trunk/Source/_javascript_Core/wasm/generateWasmValidateInlinesHeader.py 2017-01-14 18:45:20 UTC (rev 210768)
+++ trunk/Source/_javascript_Core/wasm/generateWasmValidateInlinesHeader.py 2017-01-14 19:35:23 UTC (rev 210769)
@@ -125,6 +125,13 @@
#if ENABLE(WEBASSEMBLY)
+#include <wtf/StdLibExtras.h>
+
+#if COMPILER(GCC) && ASSERT_DISABLED
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wreturn-type"
+#endif // COMPILER(GCC) && ASSERT_DISABLED
+
namespace JSC { namespace Wasm {
""" + unarySpecializations + binarySpecializations + """
@@ -151,6 +158,10 @@
} } // namespace JSC::Wasm
+#if COMPILER(GCC) && ASSERT_DISABLED
+#pragma GCC diagnostic pop
+#endif // COMPILER(GCC) && ASSERT_DISABLED
+
#endif // ENABLE(WEBASSEMBLY)
"""
Modified: trunk/Source/WTF/ChangeLog (210768 => 210769)
--- trunk/Source/WTF/ChangeLog 2017-01-14 18:45:20 UTC (rev 210768)
+++ trunk/Source/WTF/ChangeLog 2017-01-14 19:35:23 UTC (rev 210769)
@@ -1,3 +1,17 @@
+2017-01-14 Yusuke Suzuki <[email protected]>
+
+ WebAssembly: Suppress warnings & errors in GCC
+ https://bugs.webkit.org/show_bug.cgi?id=167049
+
+ Reviewed by Sam Weinig.
+
+ * wtf/LEBDecoder.h:
+ (WTF::LEBDecoder::decodeInt):
+ If T = int, it performs `-1 << shift`. It causes
+ warning in GCC. Instead, we first cast it to the
+ UnsignedT, perform operation and re-cast to the
+ T.
+
2017-01-13 Joseph Pecoraro <[email protected]>
Remove ENABLE(DETAILS_ELEMENT) guards
Modified: trunk/Source/WTF/wtf/LEBDecoder.h (210768 => 210769)
--- trunk/Source/WTF/wtf/LEBDecoder.h 2017-01-14 18:45:20 UTC (rev 210768)
+++ trunk/Source/WTF/wtf/LEBDecoder.h 2017-01-14 19:35:23 UTC (rev 210769)
@@ -78,8 +78,9 @@
return false;
}
+ using UnsignedT = typename std::make_unsigned<T>::type;
if (shift < numBits && (byte & 0x40))
- result |= static_cast<T>(-1) << shift;
+ result = static_cast<T>(static_cast<UnsignedT>(result) | (static_cast<UnsignedT>(-1) << shift));
return true;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes