No GC barrier needed for LclVar address expressions
authorCarol Eidt <carol.eidt@microsoft.com>
Tue, 12 Apr 2016 19:53:31 +0000 (12:53 -0700)
committerCarol Eidt <carol.eidt@microsoft.com>
Wed, 13 Apr 2016 14:14:16 +0000 (07:14 -0700)
The check for the case where a barrier is not required when writing to a
local variable needs to include the LocalVarAddr and lclVar address
expression cases.

Update per comments

Commit migrated from https://github.com/dotnet/coreclr/commit/39ac49632a499877db8b8656dc63d147c7a8fe39

src/coreclr/src/jit/gcinfo.cpp

index 68e9adc..1c7949d 100644 (file)
@@ -704,7 +704,7 @@ GCInfo::WriteBarrierForm GCInfo::gcWriteBarrierFormFromTargetAddress(GenTreePtr
             }
         }
     }
-    if (tgtAddr->OperGet() == GT_ADDR && tgtAddr->gtOp.gtOp1->OperGet() == GT_LCL_VAR)
+    if (tgtAddr->IsLocalAddrExpr() != nullptr)
     {
         // No need for a GC barrier when writing to a local variable.
         return GCInfo::WBF_NoBarrier;