Fixed compiler warnings on Windows build.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Oct 2014 22:17:09 +0000 (22:17 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Oct 2014 22:17:09 +0000 (22:17 +0000)
<https://webkit.org/b/135205>

Reviewed by Geoffrey Garen.

Benchmarking with jsc shows that perf is neutral with this change.

* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::call):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* dfg/DFGArgumentPosition.h:
(JSC::DFG::ArgumentPosition::mergeShouldNeverUnbox):
(JSC::DFG::ArgumentPosition::mergeArgumentUnboxingAwareness):
* dfg/DFGEdge.h:
(JSC::DFG::Edge::makeWord):
* dfg/DFGNodeFlags.h:
(JSC::DFG::nodeMayOverflow):
(JSC::DFG::nodeMayNegZero):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* dfg/DFGVariableAccessData.cpp:
(JSC::DFG::VariableAccessData::mergeIsCaptured):
* dfg/DFGVariableAccessData.h:
(JSC::DFG::VariableAccessData::mergeIsProfitableToUnbox):
(JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
(JSC::DFG::VariableAccessData::mergeCheckArrayHoistingFailed):
(JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
(JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/dfg/DFGArgumentPosition.h
Source/JavaScriptCore/dfg/DFGEdge.h
Source/JavaScriptCore/dfg/DFGNodeFlags.h
Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp
Source/JavaScriptCore/dfg/DFGVariableAccessData.cpp
Source/JavaScriptCore/dfg/DFGVariableAccessData.h
Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp

index 027374e..3fbb03e 100644 (file)
@@ -1,3 +1,37 @@
+2014-10-06  Mark Lam  <mark.lam@apple.com>
+
+        Fixed compiler warnings on Windows build.
+        <https://webkit.org/b/135205>
+
+        Reviewed by Geoffrey Garen.
+
+        Benchmarking with jsc shows that perf is neutral with this change.
+
+        * assembler/MacroAssemblerX86_64.h:
+        (JSC::MacroAssemblerX86_64::call):
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::CodeBlock):
+        * dfg/DFGArgumentPosition.h:
+        (JSC::DFG::ArgumentPosition::mergeShouldNeverUnbox):
+        (JSC::DFG::ArgumentPosition::mergeArgumentUnboxingAwareness):
+        * dfg/DFGEdge.h:
+        (JSC::DFG::Edge::makeWord):
+        * dfg/DFGNodeFlags.h:
+        (JSC::DFG::nodeMayOverflow):
+        (JSC::DFG::nodeMayNegZero):
+        * dfg/DFGOSRExitCompilerCommon.cpp:
+        (JSC::DFG::reifyInlinedCallFrames):
+        * dfg/DFGVariableAccessData.cpp:
+        (JSC::DFG::VariableAccessData::mergeIsCaptured):
+        * dfg/DFGVariableAccessData.h:
+        (JSC::DFG::VariableAccessData::mergeIsProfitableToUnbox):
+        (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
+        (JSC::DFG::VariableAccessData::mergeCheckArrayHoistingFailed):
+        (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
+        (JSC::DFG::VariableAccessData::mergeIsLoadedFrom):
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::getData):
+
 2014-10-06  Oliver Hunt  <oliver@apple.com>
 
         Remove incorrect assertion.
index 5f92261..6a63b12 100644 (file)
@@ -203,11 +203,11 @@ public:
 
         // Copy argument 5
         load64(Address(X86Registers::esp, 4 * sizeof(int64_t)), scratchRegister);
-        store64(scratchRegister, Address(X86Registers::esp, -4 * sizeof(int64_t)));
+        store64(scratchRegister, Address(X86Registers::esp, -4 * static_cast<int32_t>(sizeof(int64_t))));
 
         // Copy argument 6
         load64(Address(X86Registers::esp, 5 * sizeof(int64_t)), scratchRegister);
-        store64(scratchRegister, Address(X86Registers::esp, -3 * sizeof(int64_t)));
+        store64(scratchRegister, Address(X86Registers::esp, -3 * static_cast<int32_t>(sizeof(int64_t))));
 
         // We also need to allocate the shadow space on the stack for the 4 parameter registers.
         // Also, we should allocate 16 bytes for the frame pointer, and return address (not populated).
index 1547007..16a3fc1 100644 (file)
@@ -2016,7 +2016,7 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin
             // The format of this instruction is: op_profile_type regToProfile, TypeLocation*, flag, identifier?, resolveType?
             size_t instructionOffset = i + opLength - 1;
             unsigned divotStart, divotEnd;
-            GlobalVariableID globalVariableID;
+            GlobalVariableID globalVariableID = 0;
             RefPtr<TypeSet> globalTypeSet;
             bool shouldAnalyze = m_unlinkedCode->typeProfilerExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
             VirtualRegister profileRegister(pc[1].u.operand);
index b4e4ade..6100ad5 100644 (file)
@@ -64,7 +64,7 @@ public:
     
     bool mergeShouldNeverUnbox(bool shouldNeverUnbox)
     {
-        return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox | shouldNeverUnbox);
+        return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox || shouldNeverUnbox);
     }
     
     bool mergeArgumentPredictionAwareness()
@@ -93,7 +93,7 @@ public:
         bool changed = false;
         for (unsigned i = 0; i < m_variables.size(); ++i) {
             VariableAccessData* variable = m_variables[i]->find();
-            changed |= checkAndSet(m_isProfitableToUnbox, m_isProfitableToUnbox | variable->isProfitableToUnbox());
+            changed |= checkAndSet(m_isProfitableToUnbox, m_isProfitableToUnbox || variable->isProfitableToUnbox());
         }
         if (!changed)
             return false;
index 73bca9c..5d4b322 100644 (file)
@@ -201,7 +201,7 @@ private:
         ASSERT((shiftedValue >> shift()) == bitwise_cast<uintptr_t>(node));
         ASSERT(useKind >= 0 && useKind < LastUseKind);
         ASSERT((static_cast<uintptr_t>(LastUseKind) << 2) <= (static_cast<uintptr_t>(2) << shift()));
-        return shiftedValue | (static_cast<uintptr_t>(useKind) << 2) | (DFG::doesKill(killStatus) << 1) | DFG::isProved(proofStatus);
+        return shiftedValue | (static_cast<uintptr_t>(useKind) << 2) | (DFG::doesKill(killStatus) << 1) | static_cast<uintptr_t>(DFG::isProved(proofStatus));
     }
     
 #else
index 808c258..547075d 100644 (file)
@@ -98,7 +98,7 @@ enum RareCaseProfilingSource {
 
 static inline bool nodeMayOverflow(NodeFlags flags, RareCaseProfilingSource source)
 {
-    NodeFlags mask;
+    NodeFlags mask = 0;
     switch (source) {
     case BaselineRareCase:
         mask = NodeMayOverflowInBaseline;
@@ -115,7 +115,7 @@ static inline bool nodeMayOverflow(NodeFlags flags, RareCaseProfilingSource sour
 
 static inline bool nodeMayNegZero(NodeFlags flags, RareCaseProfilingSource source)
 {
-    NodeFlags mask;
+    NodeFlags mask = 0;
     switch (source) {
     case BaselineRareCase:
         mask = NodeMayNegZeroInBaseline;
index f8a94b7..bc0c0f7 100644 (file)
@@ -145,7 +145,7 @@ void reifyInlinedCallFrames(CCallHelpers& jit, const OSRExitBase& exit)
         InlineCallFrame* inlineCallFrame = codeOrigin.inlineCallFrame;
         CodeBlock* baselineCodeBlock = jit.baselineCodeBlockFor(codeOrigin);
         CodeBlock* baselineCodeBlockForCaller = jit.baselineCodeBlockFor(inlineCallFrame->caller);
-        void* jumpTarget;
+        void* jumpTarget = nullptr;
         void* trueReturnPC = nullptr;
         
         unsigned callBytecodeIndex = inlineCallFrame->caller.bytecodeIndex;
index 82784c8..d199f84 100644 (file)
@@ -66,8 +66,8 @@ VariableAccessData::VariableAccessData(VirtualRegister local, bool isCaptured)
 
 bool VariableAccessData::mergeIsCaptured(bool isCaptured)
 {
-    return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox | isCaptured)
-        | checkAndSet(m_isCaptured, m_isCaptured | isCaptured);
+    return checkAndSet(m_shouldNeverUnbox, m_shouldNeverUnbox || isCaptured)
+        | checkAndSet(m_isCaptured, m_isCaptured || isCaptured);
 }
 
 bool VariableAccessData::mergeShouldNeverUnbox(bool shouldNeverUnbox)
index cfdd264..9ead285 100644 (file)
@@ -71,7 +71,7 @@ public:
     
     bool mergeIsProfitableToUnbox(bool isProfitableToUnbox)
     {
-        return checkAndSet(m_isProfitableToUnbox, m_isProfitableToUnbox | isProfitableToUnbox);
+        return checkAndSet(m_isProfitableToUnbox, m_isProfitableToUnbox || isProfitableToUnbox);
     }
     
     bool isProfitableToUnbox()
@@ -100,12 +100,12 @@ public:
 
     bool mergeStructureCheckHoistingFailed(bool failed)
     {
-        return checkAndSet(m_structureCheckHoistingFailed, m_structureCheckHoistingFailed | failed);
+        return checkAndSet(m_structureCheckHoistingFailed, m_structureCheckHoistingFailed || failed);
     }
     
     bool mergeCheckArrayHoistingFailed(bool failed)
     {
-        return checkAndSet(m_checkArrayHoistingFailed, m_checkArrayHoistingFailed | failed);
+        return checkAndSet(m_checkArrayHoistingFailed, m_checkArrayHoistingFailed || failed);
     }
     
     bool structureCheckHoistingFailed()
@@ -120,7 +120,7 @@ public:
     
     bool mergeIsArgumentsAlias(bool isArgumentsAlias)
     {
-        return checkAndSet(m_isArgumentsAlias, m_isArgumentsAlias | isArgumentsAlias);
+        return checkAndSet(m_isArgumentsAlias, m_isArgumentsAlias || isArgumentsAlias);
     }
     
     bool isArgumentsAlias()
@@ -130,7 +130,7 @@ public:
     
     bool mergeIsLoadedFrom(bool isLoadedFrom)
     {
-        return checkAndSet(m_isLoadedFrom, m_isLoadedFrom | isLoadedFrom);
+        return checkAndSet(m_isLoadedFrom, m_isLoadedFrom || isLoadedFrom);
     }
     
     void setIsLoadedFrom(bool isLoadedFrom)
index 1ac1923..dd5b44e 100644 (file)
@@ -144,7 +144,7 @@ EncodedJSValue getData(ExecState* exec)
     union {
         typename Adaptor::Type value;
         uint8_t rawBytes[dataSize];
-    } u;
+    } u = { };
 
     uint8_t* dataPtr = static_cast<uint8_t*>(dataView->vector()) + byteOffset;