Skip to content

Commit

Permalink
Reduce handle usage in mini_init_delegate ().
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed Mar 22, 2023
1 parent 4a4ae0a commit 5331eab
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/mono/mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -3883,7 +3883,7 @@ mini_init_delegate (MonoDelegateHandle delegate, MonoObjectHandle target, gpoint
if (!method && !addr) {
// Multicast delegate init
if (!mono_llvm_only) {
MONO_HANDLE_SETVAL (delegate, invoke_impl, gpointer, mono_create_delegate_trampoline (mono_handle_class (delegate)));
del->invoke_impl = mono_create_delegate_trampoline (mono_handle_class (delegate));
} else {
mini_llvmonly_init_delegate (del, NULL);
}
Expand All @@ -3908,13 +3908,11 @@ mini_init_delegate (MonoDelegateHandle delegate, MonoObjectHandle target, gpoint
}

if (method)
MONO_HANDLE_SETVAL (delegate, method, MonoMethod*, method);

del->method = method;
if (addr)
MONO_HANDLE_SETVAL (delegate, method_ptr, gpointer, addr);

MONO_HANDLE_SET (delegate, target, target);
MONO_HANDLE_SETVAL (delegate, invoke_impl, gpointer, mono_create_delegate_trampoline (mono_handle_class (delegate)));
del->method_ptr = addr;
MONO_OBJECT_SETREF_INTERNAL (del, target, MONO_HANDLE_RAW (target));
del->invoke_impl = mono_create_delegate_trampoline (mono_handle_class (delegate));

MonoDelegateTrampInfo *info = NULL;

Expand Down

0 comments on commit 5331eab

Please sign in to comment.