Skip to content

Commit 12db128

Browse files
author
Mark Lam
committed
[Win] JSC Build Warnings Need to be Resolved.
<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. Canonical link: https://commits.webkit.org/160580@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 617bf63 commit 12db128

7 files changed

Lines changed: 36 additions & 7 deletions

File tree

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2015-03-10 Mark Lam <mark.lam@apple.com>
2+
3+
[Win] JSC Build Warnings Need to be Resolved.
4+
<https://webkit.org/b/142366>
5+
6+
Reviewed by Brent Fulgham.
7+
8+
Applied some benign changes to make the MSVC compiler happy.
9+
10+
* bytecode/CodeBlock.cpp:
11+
(JSC::CodeBlock::dumpBytecode):
12+
* dfg/DFGSpeculativeJIT32_64.cpp:
13+
(JSC::DFG::SpeculativeJIT::fillJSValue):
14+
* runtime/BasicBlockLocation.cpp:
15+
(JSC::BasicBlockLocation::getExecutedRanges):
16+
* runtime/ControlFlowProfiler.cpp:
17+
(JSC::ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted):
18+
119
2015-03-10 Yusuke Suzuki <utatane.tea@gmail.com>
220

321
Upgrade Map, Set and WeakMap constructor interface

‎Source/JavaScriptCore/bytecode/CodeBlock.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ void CodeBlock::dumpBytecode(PrintStream& out)
607607
out.printf("\nConstants:\n");
608608
size_t i = 0;
609609
do {
610-
const char* sourceCodeRepresentationDescription;
610+
const char* sourceCodeRepresentationDescription = nullptr;
611611
switch (m_constantsSourceCodeRepresentation[i]) {
612612
case SourceCodeRepresentation::Double:
613613
sourceCodeRepresentationDescription = ": in source as double";

‎Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ bool SpeculativeJIT::fillJSValue(Edge edge, GPRReg& tagGPR, GPRReg& payloadGPR,
111111
m_gprs.lock(gpr);
112112
}
113113
tagGPR = allocate();
114-
uint32_t tag = JSValue::EmptyValueTag;
114+
int32_t tag = JSValue::EmptyValueTag;
115115
DataFormat fillFormat = DataFormatJS;
116116
switch (info.registerFormat()) {
117117
case DataFormatInt32:

‎Source/JavaScriptCore/runtime/BasicBlockLocation.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Vector<std::pair<int, int>> BasicBlockLocation::getExecutedRanges() const
5454
int nextRangeStart = m_startOffset;
5555
while (gaps.size()) {
5656
Gap minGap(INT_MAX, 0);
57-
unsigned minIdx = -1;
57+
unsigned minIdx = std::numeric_limits<unsigned>::max();
5858
for (unsigned idx = 0; idx < gaps.size(); idx++) {
5959
// 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.
6060
if (gaps[idx].first < minGap.first) {

‎Source/JavaScriptCore/runtime/ControlFlowProfiler.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ bool ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted(int offset, intp
104104
int bestDistance = INT_MAX;
105105
BasicBlockRange bestRange;
106106
bestRange.m_startOffset = bestRange.m_endOffset = -1;
107+
bestRange.m_hasExecuted = false; // Suppress MSVC warning.
107108
// Because some ranges may overlap because of function boundaries, make sure to find the smallest range enclosing the offset.
108109
for (BasicBlockRange range : blocks) {
109110
if (range.m_startOffset <= offset && offset <= range.m_endOffset && (range.m_endOffset - range.m_startOffset) < bestDistance) {

‎Source/WTF/ChangeLog‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2015-03-10 Mark Lam <mark.lam@apple.com>
2+
3+
[Win] JSC Build Warnings Need to be Resolved.
4+
<https://webkit.org/b/142366>
5+
6+
Reviewed by Brent Fulgham.
7+
8+
* wtf/Compiler.h:
9+
- MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.
10+
111
2015-03-10 Geoffrey Garen <ggaren@apple.com>
212

313
bmalloc: tryFastMalloc shouldn't crash

‎Source/WTF/wtf/Compiler.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@
8181
#define WTF_COMPILER_SUPPORTS_CXX_USER_LITERALS 1
8282
#endif
8383

84-
#if !COMPILER(CLANG)
85-
#define WTF_COMPILER_QUIRK_CONSIDERS_UNREACHABLE_CODE 1
86-
#endif
87-
8884
#if COMPILER(GCC) && !COMPILER(CLANG) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
8985
#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT 1
9086
#endif
@@ -128,6 +124,10 @@
128124
#define WTF_COMPILER_SUNCC 1
129125
#endif
130126

127+
#if !COMPILER(CLANG) && !COMPILER(MSVC)
128+
#define WTF_COMPILER_QUIRK_CONSIDERS_UNREACHABLE_CODE 1
129+
#endif
130+
131131
/* ==== COMPILER_SUPPORTS - additional compiler feature detection, in alphabetical order ==== */
132132

133133
/* COMPILER_SUPPORTS(EABI) */

0 commit comments

Comments
 (0)