diff --git a/Build/Chakra.Build.props b/Build/Chakra.Build.props index bf7c239d1c4..fb527945b72 100644 --- a/Build/Chakra.Build.props +++ b/Build/Chakra.Build.props @@ -27,7 +27,6 @@ %(DisableSpecificWarnings); - 4457; 4458; 4312; diff --git a/lib/Backend/GlobOpt.cpp b/lib/Backend/GlobOpt.cpp index 4f19aacd9cc..fb9e65b351c 100644 --- a/lib/Backend/GlobOpt.cpp +++ b/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) { diff --git a/lib/Backend/IRBuilder.cpp b/lib/Backend/IRBuilder.cpp index 70132d07f30..e201863b5bd 100644 --- a/lib/Backend/IRBuilder.cpp +++ b/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(); diff --git a/lib/Backend/Lower.cpp b/lib/Backend/Lower.cpp index 938fe19f4a1..ef8bd58aae3 100644 --- a/lib/Backend/Lower.cpp +++ b/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; } diff --git a/lib/Backend/LowerMDSharedSimd128.cpp b/lib/Backend/LowerMDSharedSimd128.cpp index 5046611a798..f2660febb23 100644 --- a/lib/Backend/LowerMDSharedSimd128.cpp +++ b/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 diff --git a/lib/Runtime/Base/EtwTrace.cpp b/lib/Runtime/Base/EtwTrace.cpp index 8dce0979134..1b35325a003 100644 --- a/lib/Runtime/Base/EtwTrace.cpp +++ b/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) { diff --git a/lib/Runtime/ByteCode/ByteCodeEmitter.cpp b/lib/Runtime/ByteCode/ByteCodeEmitter.cpp index 020e4130659..9aec6a5a60c 100644 --- a/lib/Runtime/ByteCode/ByteCodeEmitter.cpp +++ b/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); diff --git a/lib/Runtime/Library/RegexHelper.cpp b/lib/Runtime/Library/RegexHelper.cpp index c174340bbe4..ac2eec4aadb 100644 --- a/lib/Runtime/Library/RegexHelper.cpp +++ b/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); diff --git a/lib/Runtime/Types/PathTypeHandler.cpp b/lib/Runtime/Types/PathTypeHandler.cpp index ee533dbfc39..1c4074857a3 100644 --- a/lib/Runtime/Types/PathTypeHandler.cpp +++ b/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;