[Win] JSC Build Warnings Need to be Resolved.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Mar 2015 19:29:13 +0000 (19:29 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Mar 2015 19:29:13 +0000 (19:29 +0000)
<https://webkit.org/b/142366>

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

Applied some benign changes to make the MSVC compiler happy.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::fillJSValue):
* runtime/BasicBlockLocation.cpp:
(JSC::BasicBlockLocation::getExecutedRanges):
* runtime/ControlFlowProfiler.cpp:
(JSC::ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted):

Source/WTF:

* wtf/Compiler.h:
- MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/runtime/BasicBlockLocation.cpp
Source/JavaScriptCore/runtime/ControlFlowProfiler.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/Compiler.h

index 6251719..62ab3fe 100644 (file)
@@ -1,3 +1,21 @@
+2015-03-10  Mark Lam  <mark.lam@apple.com>
+
+        [Win] JSC Build Warnings Need to be Resolved.
+        <https://webkit.org/b/142366>
+
+        Reviewed by Brent Fulgham.
+
+        Applied some benign changes to make the MSVC compiler happy.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dumpBytecode):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::fillJSValue):
+        * runtime/BasicBlockLocation.cpp:
+        (JSC::BasicBlockLocation::getExecutedRanges):
+        * runtime/ControlFlowProfiler.cpp:
+        (JSC::ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted):
+
 2015-03-10  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         Upgrade Map, Set and WeakMap constructor interface
index 335cbca..d26ee2b 100644 (file)
@@ -607,7 +607,7 @@ void CodeBlock::dumpBytecode(PrintStream& out)
         out.printf("\nConstants:\n");
         size_t i = 0;
         do {
-            const char* sourceCodeRepresentationDescription;
+            const char* sourceCodeRepresentationDescription = nullptr;
             switch (m_constantsSourceCodeRepresentation[i]) {
             case SourceCodeRepresentation::Double:
                 sourceCodeRepresentationDescription = ": in source as double";
index c2d18a1..e97dd43 100644 (file)
@@ -111,7 +111,7 @@ bool SpeculativeJIT::fillJSValue(Edge edge, GPRReg& tagGPR, GPRReg& payloadGPR,
             m_gprs.lock(gpr);
         }
         tagGPR = allocate();
-        uint32_t tag = JSValue::EmptyValueTag;
+        int32_t tag = JSValue::EmptyValueTag;
         DataFormat fillFormat = DataFormatJS;
         switch (info.registerFormat()) {
         case DataFormatInt32:
index 167fb66..33cc396 100644 (file)
@@ -54,7 +54,7 @@ Vector<std::pair<int, int>> BasicBlockLocation::getExecutedRanges() const
     int nextRangeStart = m_startOffset;
     while (gaps.size()) {
         Gap minGap(INT_MAX, 0);
-        unsigned minIdx = -1;
+        unsigned minIdx = std::numeric_limits<unsigned>::max();
         for (unsigned idx = 0; idx < gaps.size(); idx++) {
             // Because we know that the Gaps inside m_gaps aren't enclosed within one another, it suffices to just check the first element to test ordering.
             if (gaps[idx].first < minGap.first) {
index 461cdac..d80e7f3 100644 (file)
@@ -104,6 +104,7 @@ bool ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted(int offset, intp
     int bestDistance = INT_MAX;
     BasicBlockRange bestRange;
     bestRange.m_startOffset = bestRange.m_endOffset = -1;
+    bestRange.m_hasExecuted = false; // Suppress MSVC warning.
     // Because some ranges may overlap because of function boundaries, make sure to find the smallest range enclosing the offset.
     for (BasicBlockRange range : blocks) {
         if (range.m_startOffset <= offset && offset <= range.m_endOffset && (range.m_endOffset - range.m_startOffset) < bestDistance) {
index 639937f..ae1b4fe 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-10  Mark Lam  <mark.lam@apple.com>
+
+        [Win] JSC Build Warnings Need to be Resolved.
+        <https://webkit.org/b/142366>
+
+        Reviewed by Brent Fulgham.
+
+        * wtf/Compiler.h:
+        - MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.
+
 2015-03-10  Geoffrey Garen  <ggaren@apple.com>
 
         bmalloc: tryFastMalloc shouldn't crash
index 2c94973..7d4accb 100644 (file)
 #define WTF_COMPILER_SUPPORTS_CXX_USER_LITERALS 1
 #endif
 
-#if !COMPILER(CLANG)
-#define WTF_COMPILER_QUIRK_CONSIDERS_UNREACHABLE_CODE 1
-#endif
-
 #if COMPILER(GCC) && !COMPILER(CLANG) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
 #define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT 1
 #endif
 #define WTF_COMPILER_SUNCC 1
 #endif
 
+#if !COMPILER(CLANG) && !COMPILER(MSVC)
+#define WTF_COMPILER_QUIRK_CONSIDERS_UNREACHABLE_CODE 1
+#endif
+
 /* ==== COMPILER_SUPPORTS - additional compiler feature detection, in alphabetical order ==== */
 
 /* COMPILER_SUPPORTS(EABI) */