Fix incorrect comment
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 20 Jan 2017 21:42:28 +0000 (16:42 -0500)
committerJoseph Tremoulet <jotrem@microsoft.com>
Sat, 21 Jan 2017 01:30:35 +0000 (20:30 -0500)
Rewrite bogus reference to nonexistsent `m_HeapDef` to correctly refer to
`block->bbHeapDef`.  Also change "doesn't kill heap" to "doesn't kill heap
liveness" (since it still kills availability).

Also add clarifying comments where `bbHeapUse` and `bbHeapDef` are
declared.

Commit migrated from https://github.com/dotnet/coreclr/commit/1082757a43da09c22018a5457649b121b64a2d64

src/coreclr/src/jit/block.h
src/coreclr/src/jit/liveness.cpp

index cb02afd..3d45ea0 100644 (file)
@@ -809,8 +809,8 @@ struct BasicBlock : private LIR::Range
     VARSET_TP bbLiveOut; // variables live on exit
 
     // Use, def, live in/out information for the implicit "Heap" variable.
-    unsigned bbHeapUse : 1;
-    unsigned bbHeapDef : 1;
+    unsigned bbHeapUse : 1; // must be set to true for any block that references the global Heap
+    unsigned bbHeapDef : 1; // must be set to true for any block that mutates the global Heap
     unsigned bbHeapLiveIn : 1;
     unsigned bbHeapLiveOut : 1;
     unsigned bbHeapHavoc : 1; // If true, at some point the block does an operation that leaves the heap
index 569debb..08e13b6 100644 (file)
@@ -1129,8 +1129,8 @@ class LiveVarAnalysis
         VarSetOps::DiffD(m_compiler, m_liveIn, block->bbVarDef);
         VarSetOps::UnionD(m_compiler, m_liveIn, block->bbVarUse);
 
-        // Even if m_heapDef is set, we must assume that it doesn't kill heap if m_heapLiveOut, since
-        // (without proof otherwise) the use and def may touch different heap memory at run-time.
+        // Even if block->bbHeapDef is set, we must assume that it doesn't kill heap liveness from m_heapLiveOut,
+        // since (without proof otherwise) the use and def may touch different heap memory at run-time.
         m_heapLiveIn = m_heapLiveOut || block->bbHeapUse;
 
         /* Can exceptions from this block be handled (in this function)? */