Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Mar 5, 2024
1 parent 55b3672 commit 7a2df9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ public override MethodIL EmitIL()
}

// Fill in delegateArrayLocal
// Wrapper[] delegateArrayLocal = (Wrapper[])this._helperObject
// Delegate.Wrapper[] delegateArrayLocal = (Delegate.Wrapper[])this._helperObject

// ldarg.0 (this pointer)
// ldfld Delegate.HelperObjectField
// castclass Wrapper[]
// ldfld Delegate._helperObject
// castclass Delegate.Wrapper[]
// stloc delegateArrayLocal
codeStream.EmitLdArg(0);
codeStream.Emit(ILOpcode.ldfld, emitter.NewToken(HelperObjectField));
Expand All @@ -332,6 +332,7 @@ public override MethodIL EmitIL()

// Fill in invocationCountLocal
// int invocationCountLocal = this._extraFunctionPointerOrData

// ldarg.0 (this pointer)
// ldfld Delegate._extraFunctionPointerOrData
// stloc invocationCountLocal
Expand All @@ -357,8 +358,8 @@ public override MethodIL EmitIL()

// ldloc delegateArrayLocal
// ldloc iteratorLocal
// ldelema System.Delegate
// ldfld Wrapper.Value
// ldelema Delegate.Wrapper
// ldfld Delegate.Wrapper.Value
// stloc delegateToCallLocal
codeStream.EmitLdLoc(delegateArrayLocal);
codeStream.EmitLdLoc(iteratorLocal);
Expand All @@ -370,10 +371,10 @@ public override MethodIL EmitIL()
// returnValueLocal = delegateToCallLocal(...);

// ldloc delegateToCallLocal
// ldfld System.Delegate._firstParameter
// ldfld Delegate._firstParameter
// ldarg 1, n
// ldloc delegateToCallLocal
// ldfld System.Delegate._functionPointer
// ldfld Delegate._functionPointer
// calli returnValueType thiscall (all the params)
// IF there is a return value
// stloc returnValueLocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ unsafe partial class CorInfoImpl
{
private const CORINFO_RUNTIME_ABI TargetABI = CORINFO_RUNTIME_ABI.CORINFO_CORECLR_ABI;

private uint OffsetOfDelegateFirstTarget => (uint)(3 * PointerSize); // Delegate::_functionPointer
private uint OffsetOfDelegateFirstTarget => (uint)(3 * PointerSize); // Delegate._methodPtr

private readonly ReadyToRunCodegenCompilation _compilation;
private MethodWithGCInfo _methodCodeNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal unsafe partial class CorInfoImpl
{
private const CORINFO_RUNTIME_ABI TargetABI = CORINFO_RUNTIME_ABI.CORINFO_NATIVEAOT_ABI;

private uint OffsetOfDelegateFirstTarget => (uint)(4 * PointerSize); // Delegate::_functionPointer
private uint OffsetOfDelegateFirstTarget => (uint)(4 * PointerSize); // Delegate._functionPointer
private int SizeOfReversePInvokeTransitionFrame => 2 * PointerSize;

private RyuJitCompilation _compilation;
Expand Down

0 comments on commit 7a2df9b

Please sign in to comment.