@@ -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}
0 commit comments