2
0
Эх сурвалжийг харах

Reenable and fix warning 4457 - declaration of '' hides function parameter

Curtis Man 9 жил өмнө
parent
commit
8223b6d2c1

+ 0 - 1
Build/Chakra.Build.props

@@ -27,7 +27,6 @@
       <!-- REVIEW: These are warning are introduced when moving to VS2015 tools, may want to clean these up -->
       <DisableSpecificWarnings>
         %(DisableSpecificWarnings);
-        4457;     <!-- declaration of '' hides function parameter -->
         4458;     <!-- declaration of '' hides class member -->
         4312;     <!-- 'type cast': conversion from '' to '' of greater size -->
       </DisableSpecificWarnings>

+ 8 - 8
lib/Backend/GlobOpt.cpp

@@ -18545,14 +18545,14 @@ GlobOpt::OptHoistInvariant(
 
             if (instr->HasBailOutInfo())
             {
-                IR::BailOutKind bailoutKind = instr->GetBailOutKind();
-                Assert(bailoutKind == IR::BailOutIntOnly ||
-                    bailoutKind == IR::BailOutExpectingInteger ||
-                    bailoutKind == IR::BailOutOnNotPrimitive ||
-                    bailoutKind == IR::BailOutNumberOnly ||
-                    bailoutKind == IR::BailOutPrimitiveButString ||
-                    bailoutKind == IR::BailOutSimd128F4Only ||
-                    bailoutKind == IR::BailOutSimd128I4Only);
+                IR::BailOutKind instrBailoutKind = instr->GetBailOutKind();
+                Assert(instrBailoutKind == IR::BailOutIntOnly ||
+                    instrBailoutKind == IR::BailOutExpectingInteger ||
+                    instrBailoutKind == IR::BailOutOnNotPrimitive ||
+                    instrBailoutKind == IR::BailOutNumberOnly ||
+                    instrBailoutKind == IR::BailOutPrimitiveButString ||
+                    instrBailoutKind == IR::BailOutSimd128F4Only ||
+                    instrBailoutKind == IR::BailOutSimd128I4Only);
             }
             else if (src1StackSym && bailoutKind != IR::BailOutInvalid)
             {

+ 5 - 5
lib/Backend/IRBuilder.cpp

@@ -6851,15 +6851,15 @@ IRBuilder::ResolveVirtualLongBranch(IR::BranchInstr * branchInstr, uint offset)
         branchInstr->InsertBefore(returnIPInstr);
 
         // Any jump to this branch to jump to the return IP load instr first
-        uint32 offset = branchInstr->GetByteCodeOffset();
-        if (this->m_offsetToInstruction[offset] == branchInstr)
+        uint32 branchInstrByteCodeOffset = branchInstr->GetByteCodeOffset();
+        if (this->m_offsetToInstruction[branchInstrByteCodeOffset] == branchInstr)
         {
-            this->m_offsetToInstruction[offset] = returnIPInstr;
+            this->m_offsetToInstruction[branchInstrByteCodeOffset] = returnIPInstr;
         }
         else
         {
-            Assert(this->m_offsetToInstruction[offset]->HasBailOutInfo() &&
-                   this->m_offsetToInstruction[offset]->GetBailOutKind() == IR::BailOutInjected);
+            Assert(this->m_offsetToInstruction[branchInstrByteCodeOffset]->HasBailOutInfo() &&
+                   this->m_offsetToInstruction[branchInstrByteCodeOffset]->GetBailOutKind() == IR::BailOutInjected);
         }
     }
     return GetLoopBodyExitInstrOffset();

+ 2 - 2
lib/Backend/Lower.cpp

@@ -12228,8 +12228,8 @@ Lowerer::GenerateBailOut(IR::Instr * instr, IR::BranchInstr * branchInstr, IR::L
 #endif
         Assert(bailOutLabel == nullptr || bailOutLabel == bailOutTargetLabel);
 
-        IR::BranchInstr * branchInstr = IR::BranchInstr::New(LowererMD::MDUncondBranchOpcode, bailOutTargetLabel, this->m_func);
-        instr->InsertAfter(branchInstr);
+        IR::BranchInstr * newBranchInstr = IR::BranchInstr::New(LowererMD::MDUncondBranchOpcode, bailOutTargetLabel, this->m_func);
+        instr->InsertAfter(newBranchInstr);
         instr->Remove();
         return collectRuntimeStatsLabel ? collectRuntimeStatsLabel : bailOutLabel;
     }

+ 2 - 2
lib/Backend/LowerMDSharedSimd128.cpp

@@ -3070,9 +3070,9 @@ LowererMD::Simd128LoadHeadSegment(IR::IndirOpnd *indirOpnd, ValueType arrType, I
     {
         //  MOV headSegment, [base + offset(head)]
         int32 headOffset = m_lowerer->GetArrayOffsetOfHeadSegment(arrType);
-        IR::IndirOpnd * indirOpnd = IR::IndirOpnd::New(arrayRegOpnd, headOffset, TyMachPtr, this->m_func);
+        IR::IndirOpnd * newIndirOpnd = IR::IndirOpnd::New(arrayRegOpnd, headOffset, TyMachPtr, this->m_func);
         headSegmentOpnd = IR::RegOpnd::New(TyMachPtr, this->m_func);
-        m_lowerer->InsertMove(headSegmentOpnd, indirOpnd, instr);
+        m_lowerer->InsertMove(headSegmentOpnd, newIndirOpnd, instr);
     }
 
     // change base to be the head segment instead of the array object

+ 3 - 3
lib/Runtime/Base/EtwTrace.cpp

@@ -371,6 +371,7 @@ void EtwTrace::LogMethodNativeLoadEvent(FunctionBody* body, FunctionEntryPointIn
 
 void EtwTrace::LogLoopBodyLoadEvent(FunctionBody* body, LoopHeader* loopHeader, LoopEntryPointInfo* entryPoint, uint16 loopNumber)
 {
+    Assert(loopNumber == body->GetLoopNumberWithLock(loopHeader));
     LogLoopBodyEventBG(EventWriteMethodLoad, body, loopHeader, entryPoint, loopNumber);
 
 #ifdef VTUNE_PROFILING
@@ -387,8 +388,7 @@ void EtwTrace::LogLoopBodyLoadEvent(FunctionBody* body, LoopHeader* loopHeader,
         {
             methodInfo.method_id = iJIT_GetNewMethodID();
             size_t len = utf8::EncodeInto(utf8MethodName, methodName, (charcount_t)methodLength);
-            uint loopNumber = body->GetLoopNumber(loopHeader) + 1;
-            sprintf_s((char*)(utf8MethodName + len), length - len," %s %d", LoopStr, loopNumber);
+            sprintf_s((char*)(utf8MethodName + len), length - len," %s %d", LoopStr, loopNumber + 1);
             methodInfo.method_name = (char*)utf8MethodName;
             methodInfo.method_load_address = (void*)entryPoint->GetNativeAddress();
             methodInfo.method_size = (uint)entryPoint->GetCodeSize();        // Size in memory - Must be exact
@@ -399,7 +399,7 @@ void EtwTrace::LogLoopBodyLoadEvent(FunctionBody* body, LoopHeader* loopHeader,
             methodInfo.env = iJDE_JittingAPI;
 
             iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &methodInfo);
-            OUTPUT_TRACE(Js::ProfilerPhase, _u("Loop body load event: %s Loop %d\n"), methodName, loopNumber);
+            OUTPUT_TRACE(Js::ProfilerPhase, _u("Loop body load event: %s Loop %d\n"), methodName, loopNumber + 1);
 
             if(urlLength > 0)
             {

+ 4 - 6
lib/Runtime/ByteCode/ByteCodeEmitter.cpp

@@ -7264,9 +7264,8 @@ void EmitCallTarget(
         }
 
         Emit(pnodeTarget->sxBin.pnode1, byteCodeGenerator, funcInfo, false);
-        Js::PropertyId propertyId = pnodeTarget->sxBin.pnode2->sxPid.PropertyIdFromNameNode();
-        Js::RegSlot callObjLocation = pnodeTarget->sxBin.pnode1->location;
-        Js::RegSlot protoLocation = callObjLocation;
+        Js::PropertyId propertyId = pnodeTarget->sxBin.pnode2->sxPid.PropertyIdFromNameNode();        
+        Js::RegSlot protoLocation = pnodeTarget->sxBin.pnode1->location;
         EmitSuperMethodBegin(pnodeTarget, byteCodeGenerator, funcInfo);
         EmitMethodFld(pnodeTarget, protoLocation, propertyId, byteCodeGenerator, funcInfo);
 
@@ -7289,9 +7288,8 @@ void EmitCallTarget(
         Emit(pnodeTarget->sxBin.pnode1, byteCodeGenerator, funcInfo, false);
         Emit(pnodeTarget->sxBin.pnode2, byteCodeGenerator, funcInfo, false);
 
-        Js::RegSlot indexLocation = pnodeTarget->sxBin.pnode2->location;
-        Js::RegSlot callObjLocation = pnodeTarget->sxBin.pnode1->location;
-        Js::RegSlot protoLocation = callObjLocation;
+        Js::RegSlot indexLocation = pnodeTarget->sxBin.pnode2->location;        
+        Js::RegSlot protoLocation = pnodeTarget->sxBin.pnode1->location;
         EmitSuperMethodBegin(pnodeTarget, byteCodeGenerator, funcInfo);
         EmitMethodElem(pnodeTarget, protoLocation, indexLocation, byteCodeGenerator);
 

+ 1 - 1
lib/Runtime/Library/RegexHelper.cpp

@@ -966,7 +966,7 @@ namespace Js
 
         BEGIN_TEMP_ALLOCATOR(tempAlloc, scriptContext, _u("RegexHelper"))
         {
-            results->Map([&](int i, RecyclableObject* resultObj) {
+            results->Map([&](int resultIndex, RecyclableObject* resultObj) {
                 int64 length = JavascriptConversion::ToLength(
                     JavascriptOperators::GetProperty(resultObj, PropertyIds::length, scriptContext),
                     scriptContext);

+ 4 - 4
lib/Runtime/Types/PathTypeHandler.cpp

@@ -1045,14 +1045,14 @@ namespace Js
                 {
                     typeHandlerToUpdate->typePath = newTypePath;
 
-                    DynamicType * predecessorType = typeHandlerToUpdate->GetPredecessorType();
-                    if (predecessorType == nullptr)
+                    DynamicType * currPredecessorType = typeHandlerToUpdate->GetPredecessorType();
+                    if (currPredecessorType == nullptr)
                     {
                         break;
                     }
 
-                    Assert(predecessorType->GetTypeHandler()->IsPathTypeHandler());
-                    typeHandlerToUpdate = (PathTypeHandlerBase *)predecessorType->GetTypeHandler();
+                    Assert(currPredecessorType->GetTypeHandler()->IsPathTypeHandler());
+                    typeHandlerToUpdate = (PathTypeHandlerBase *)currPredecessorType->GetTypeHandler();
                     if (typeHandlerToUpdate->typePath != oldTypePath)
                     {
                         break;