Skip to content

Commit c8cc004

Browse files
committed
Another rename
1 parent e58f5ed commit c8cc004

File tree

5 files changed

+161
-165
lines changed

5 files changed

+161
-165
lines changed

src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal DynamicILGenerator(DynamicMethod method, byte[] methodSignature, int si
2323

2424
internal void GetCallableMethod(RuntimeModule module, DynamicMethod dm)
2525
{
26-
dm.methodHandle = ModuleHandle.GetDynamicMethod(dm,
26+
dm._methodHandle = ModuleHandle.GetDynamicMethod(dm,
2727
module,
2828
m_methodBuilder.Name,
2929
(byte[])m_scope[m_methodSigToken]!,
@@ -590,7 +590,7 @@ internal DynamicResolver(DynamicILGenerator ilGenerator)
590590
m_scope = ilGenerator.m_scope;
591591

592592
m_method = (DynamicMethod)ilGenerator.m_methodBuilder;
593-
m_method.resolver = this;
593+
m_method._resolver = this;
594594
}
595595

596596
internal DynamicResolver(DynamicILInfo dynamicILInfo)
@@ -602,7 +602,7 @@ internal DynamicResolver(DynamicILInfo dynamicILInfo)
602602
m_scope = dynamicILInfo.DynamicScope;
603603

604604
m_method = dynamicILInfo.DynamicMethod;
605-
m_method.resolver = this;
605+
m_method._resolver = this;
606606
}
607607

608608
//
@@ -628,7 +628,7 @@ internal DynamicResolver(DynamicILInfo dynamicILInfo)
628628
if (method == null)
629629
return;
630630

631-
if (method.methodHandle == null)
631+
if (method._methodHandle == null)
632632
return;
633633

634634
DestroyScout scout;
@@ -645,7 +645,7 @@ internal DynamicResolver(DynamicILInfo dynamicILInfo)
645645

646646
// We can never ever have two active destroy scouts for the same method. We need to initialize the scout
647647
// outside the try/reregister block to avoid possibility of reregistration for finalization with active scout.
648-
scout.m_methodHandle = method.methodHandle.Value;
648+
scout.m_methodHandle = method._methodHandle.Value;
649649
}
650650

651651
private sealed class DestroyScout
@@ -687,12 +687,12 @@ internal enum SecurityControlFlags
687687

688688
SecurityControlFlags flags = SecurityControlFlags.Default;
689689

690-
if (m_method.restrictedSkipVisibility)
690+
if (m_method._restrictedSkipVisibility)
691691
flags |= SecurityControlFlags.RestrictedSkipVisibilityChecks;
692-
else if (m_method.skipVisibility)
692+
else if (m_method._skipVisibility)
693693
flags |= SecurityControlFlags.SkipVisibilityChecks;
694694

695-
typeOwner = m_method.typeOwner;
695+
typeOwner = m_method._typeOwner;
696696

697697
securityControlFlags = (int)flags;
698698

@@ -884,7 +884,7 @@ internal DynamicILInfo(DynamicMethod method, byte[] methodSignature)
884884
#region Internal Methods
885885
internal void GetCallableMethod(RuntimeModule module, DynamicMethod dm)
886886
{
887-
dm.methodHandle = ModuleHandle.GetDynamicMethod(dm,
887+
dm._methodHandle = ModuleHandle.GetDynamicMethod(dm,
888888
module, m_method.Name, (byte[])m_scope[m_methodSignature]!, new DynamicResolver(this));
889889
}
890890

src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.CoreCLR.cs

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,43 @@ namespace System.Reflection.Emit
1515
{
1616
public sealed partial class DynamicMethod : MethodInfo
1717
{
18-
private RuntimeType[] parameterTypes;
19-
internal IRuntimeMethodInfo? methodHandle;
20-
private RuntimeType returnType;
21-
private DynamicILGenerator? ilGenerator;
22-
private DynamicILInfo? dynamicILInfo;
23-
private bool initLocals;
24-
private Module module;
25-
internal bool skipVisibility;
26-
internal RuntimeType? typeOwner;
27-
private MethodInvoker? invoker;
28-
private Signature? signature;
18+
private RuntimeType[] _parameterTypes;
19+
internal IRuntimeMethodInfo? _methodHandle;
20+
private RuntimeType _returnType;
21+
private DynamicILGenerator? _ilGenerator;
22+
private DynamicILInfo? _dynamicILInfo;
23+
private bool _initLocals;
24+
private Module _module;
25+
internal bool _skipVisibility;
26+
internal RuntimeType? _typeOwner;
27+
private MethodInvoker? _invoker;
28+
private Signature? _signature;
2929

3030
// We want the creator of the DynamicMethod to control who has access to the
3131
// DynamicMethod (just like we do for delegates). However, a user can get to
3232
// the corresponding RTDynamicMethod using Exception.TargetSite, StackFrame.GetMethod, etc.
3333
// If we allowed use of RTDynamicMethod, the creator of the DynamicMethod would
3434
// not be able to bound access to the DynamicMethod. Hence, we need to ensure that
3535
// we do not allow direct use of RTDynamicMethod.
36-
private RTDynamicMethod dynMethod;
36+
private RTDynamicMethod _dynMethod;
3737

3838
// needed to keep the object alive during jitting
3939
// assigned by the DynamicResolver ctor
40-
internal DynamicResolver? resolver;
40+
internal DynamicResolver? _resolver;
4141

42-
internal bool restrictedSkipVisibility;
42+
internal bool _restrictedSkipVisibility;
4343

4444
//
4545
// Delegate and method creation
4646
//
4747

4848
public sealed override Delegate CreateDelegate(Type delegateType)
4949
{
50-
if (restrictedSkipVisibility)
50+
if (_restrictedSkipVisibility)
5151
{
5252
// Compile the method since accessibility checks are done as part of compilation.
5353
GetMethodDescriptor();
54-
IRuntimeMethodInfo? methodHandle = this.methodHandle;
54+
IRuntimeMethodInfo? methodHandle = _methodHandle;
5555
System.Runtime.CompilerServices.RuntimeHelpers.CompileMethod(methodHandle != null ? methodHandle.Value : RuntimeMethodHandleInternal.EmptyHandle);
5656
GC.KeepAlive(methodHandle);
5757
}
@@ -64,11 +64,11 @@ public sealed override Delegate CreateDelegate(Type delegateType)
6464

6565
public sealed override Delegate CreateDelegate(Type delegateType, object? target)
6666
{
67-
if (restrictedSkipVisibility)
67+
if (_restrictedSkipVisibility)
6868
{
6969
// Compile the method since accessibility checks are done as part of compilation
7070
GetMethodDescriptor();
71-
IRuntimeMethodInfo? methodHandle = this.methodHandle;
71+
IRuntimeMethodInfo? methodHandle = _methodHandle;
7272
System.Runtime.CompilerServices.RuntimeHelpers.CompileMethod(methodHandle != null ? methodHandle.Value : RuntimeMethodHandleInternal.EmptyHandle);
7373
GC.KeepAlive(methodHandle);
7474
}
@@ -82,33 +82,33 @@ public sealed override Delegate CreateDelegate(Type delegateType, object? target
8282
// This is guaranteed to return a valid handle
8383
internal RuntimeMethodHandle GetMethodDescriptor()
8484
{
85-
if (methodHandle == null)
85+
if (_methodHandle == null)
8686
{
8787
lock (this)
8888
{
89-
if (methodHandle == null)
89+
if (_methodHandle == null)
9090
{
91-
if (dynamicILInfo != null)
92-
dynamicILInfo.GetCallableMethod((RuntimeModule)module, this);
91+
if (_dynamicILInfo != null)
92+
_dynamicILInfo.GetCallableMethod((RuntimeModule)_module, this);
9393
else
9494
{
95-
if (ilGenerator == null || ilGenerator.ILOffset == 0)
95+
if (_ilGenerator == null || _ilGenerator.ILOffset == 0)
9696
throw new InvalidOperationException(SR.Format(SR.InvalidOperation_BadEmptyMethodBody, Name));
9797

98-
ilGenerator.GetCallableMethod((RuntimeModule)module, this);
98+
_ilGenerator.GetCallableMethod((RuntimeModule)_module, this);
9999
}
100100
}
101101
}
102102
}
103-
return new RuntimeMethodHandle(methodHandle!);
103+
return new RuntimeMethodHandle(_methodHandle!);
104104
}
105105

106106
private MethodInvoker Invoker
107107
{
108108
[MethodImpl(MethodImplOptions.AggressiveInlining)]
109109
get
110110
{
111-
return invoker ??= new MethodInvoker(this, Signature);
111+
return _invoker ??= new MethodInvoker(this, Signature);
112112
}
113113
}
114114

@@ -120,15 +120,15 @@ internal Signature Signature
120120
[MethodImpl(MethodImplOptions.NoInlining)] // move lazy sig generation out of the hot path
121121
Signature LazyCreateSignature()
122122
{
123-
Debug.Assert(methodHandle != null);
124-
Debug.Assert(parameterTypes != null);
123+
Debug.Assert(_methodHandle != null);
124+
Debug.Assert(_parameterTypes != null);
125125

126-
Signature newSig = new Signature(methodHandle, parameterTypes, returnType, CallingConvention);
127-
Volatile.Write(ref signature, newSig);
126+
Signature newSig = new Signature(_methodHandle, _parameterTypes, _returnType, CallingConvention);
127+
Volatile.Write(ref _signature, newSig);
128128
return newSig;
129129
}
130130

131-
return signature ?? LazyCreateSignature();
131+
return _signature ?? LazyCreateSignature();
132132
}
133133
}
134134

@@ -282,24 +282,24 @@ Signature LazyCreateSignature()
282282

283283
public DynamicILInfo GetDynamicILInfo()
284284
{
285-
if (dynamicILInfo == null)
285+
if (_dynamicILInfo == null)
286286
{
287287
byte[] methodSignature = SignatureHelper.GetMethodSigHelper(
288-
null, CallingConvention, ReturnType, null, null, parameterTypes, null, null).GetSignature(true);
289-
dynamicILInfo = new DynamicILInfo(this, methodSignature);
288+
null, CallingConvention, ReturnType, null, null, _parameterTypes, null, null).GetSignature(true);
289+
_dynamicILInfo = new DynamicILInfo(this, methodSignature);
290290
}
291-
return dynamicILInfo;
291+
return _dynamicILInfo;
292292
}
293293

294294
public ILGenerator GetILGenerator(int streamSize)
295295
{
296-
if (ilGenerator == null)
296+
if (_ilGenerator == null)
297297
{
298298
byte[] methodSignature = SignatureHelper.GetMethodSigHelper(
299-
null, CallingConvention, ReturnType, null, null, parameterTypes, null, null).GetSignature(true);
300-
ilGenerator = new DynamicILGenerator(this, methodSignature, streamSize);
299+
null, CallingConvention, ReturnType, null, null, _parameterTypes, null, null).GetSignature(true);
300+
_ilGenerator = new DynamicILGenerator(this, methodSignature, streamSize);
301301
}
302-
return ilGenerator;
302+
return _ilGenerator;
303303
}
304304
}
305305
}

src/libraries/System.Linq.Expressions/tests/ILReader/ILReaderFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public static ILReader Create(object obj)
4141
private static readonly Type s_runtimeConstructorInfoType = Type.GetType("System.Reflection.RuntimeConstructorInfo", throwOnError: true);
4242

4343
private static readonly Type s_rtDynamicMethodType = Type.GetType("System.Reflection.Emit.DynamicMethod+RTDynamicMethod", throwOnError: true);
44-
private static readonly FieldInfo s_fiOwner = s_rtDynamicMethodType.GetFieldAssert("m_owner");
44+
private static readonly FieldInfo s_fiOwner = s_rtDynamicMethodType.GetFieldAssert("_owner");
4545
}
4646
}

0 commit comments

Comments
 (0)