private Instruction GetLoadField(FieldInfo field) { lock (_loadFields) { if (!_loadFields.TryGetValue(field, out var instruction)) { if (field.IsStatic) { instruction = new LoadStaticFieldInstruction(field); } else { instruction = new LoadFieldInstruction(field); } _loadFields.Add(field, instruction); } return(instruction); } }
private Instruction GetLoadField(FieldInfo field) { lock (s_loadFields) { Instruction instruction; if (!s_loadFields.TryGetValue(field, out instruction)) { if (field.IsStatic) { instruction = new LoadStaticFieldInstruction(field); } else { instruction = new LoadFieldInstruction(field); } s_loadFields.Add(field, instruction); } return instruction; } }