Renaming functions and updating comments 
authorBrian Bohe <t-brboh@microsoft.com>
Mon, 24 Feb 2020 18:15:17 +0000 (10:15 -0800)
committerBrian Bohe <t-brboh@microsoft.com>
Mon, 24 Feb 2020 18:15:17 +0000 (10:15 -0800)
src/coreclr/src/jit/codegencommon.cpp
src/coreclr/src/jit/emit.cpp
src/coreclr/src/jit/emit.h

index 703b8e6..ac14335 100644 (file)
@@ -11466,11 +11466,11 @@ void CodeGenInterface::VariableLiveKeeper::VariableLiveDescriptor::startLiveRang
     // Is the first "VariableLiveRange" or the previous one has been closed so its "m_EndEmitLocation" is valid
     noway_assert(m_VariableLiveRanges->empty() || m_VariableLiveRanges->back().m_EndEmitLocation.Valid());
 
-    if (!m_VariableLiveRanges->empty() && m_VariableLiveRanges->back().m_EndEmitLocation.IsPreviousIns(emit) &&
+    if (!m_VariableLiveRanges->empty() && m_VariableLiveRanges->back().m_EndEmitLocation.IsPreviousInsNum(emit) &&
         siVarLoc::Equals(&varLocation, &(m_VariableLiveRanges->back().m_VarLocation)))
     {
-        // The variable is being born at the exactly same place just one assembly instructtion.
-        // We assume it never died.
+        // The variable is being born just after the instruction at which it died.
+        // In this case, i.e. an update of the variable's value, we coalesce the live ranges.
         m_VariableLiveRanges->back().m_EndEmitLocation.Init();
     }
     else
index 0fc99a6..65e6886 100644 (file)
@@ -66,18 +66,18 @@ UNATIVE_OFFSET emitLocation::GetFuncletPrologOffset(emitter* emit) const
 }
 
 //------------------------------------------------------------------------
-// IsPreviousIns: Returns true if the emitter is on the next instruction
-//  of the same group than this emitLocation.
+// IsPreviousInsNum: Returns true if the emitter is on the next instruction
+//  of the same group as this emitLocation.
 //
 // Arguments:
 //  emit - an emitter* instance
 //
-bool emitLocation::IsPreviousIns(const emitter* emit) const
+bool emitLocation::IsPreviousInsNum(const emitter* emit) const
 {
     assert(Valid());
-    bool sameGroup  = ig == emit->emitCurIG;
-    bool sameInsNum = emitGetInsNumFromCodePos(codePos) == emitGetInsNumFromCodePos(emit->emitCurOffset()) - 1;
-    return sameGroup && sameInsNum;
+    bool isSameGroup  = (ig == emit->emitCurIG);
+    bool isSameInsNum = (emitGetInsNumFromCodePos(codePos) == emitGetInsNumFromCodePos(emit->emitCurOffset()) - 1);
+    return isSameGroup && isSameInsNum;
 }
 
 #ifdef DEBUG
index 89d09e3..622d6d6 100644 (file)
@@ -191,7 +191,7 @@ public:
 
     UNATIVE_OFFSET GetFuncletPrologOffset(emitter* emit) const;
 
-    bool emitLocation::IsPreviousIns(const emitter* emit) const;
+    bool emitLocation::IsPreviousInsNum(const emitter* emit) const;
 
 #ifdef DEBUG
     void Print() const;