Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5873,6 +5873,14 @@ interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClause
++sp;
MINT_IN_BREAK;
}
MINT_IN_CASE(MINT_LDFTN_DYNAMIC) {
ERROR_DECL (error);
InterpMethod *m = mono_interp_get_imethod (mono_domain_get (), (MonoMethod*) sp [-1].data.p, error);
mono_error_assert_ok (error);
sp [-1].data.p = m;
ip++;
MINT_IN_BREAK;
}

#define LDARG(datamem, argtype) \
sp->data.datamem = (argtype) frame->stack_args [*(guint16 *)(ip + 1)].data.datamem; \
Expand Down
1 change: 1 addition & 0 deletions mono/mini/interp/mintops.def
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ OPDEF(MINT_BOX_VT, "box.vt", 3, MintOpTwoShorts)
OPDEF(MINT_UNBOX, "unbox", 2, MintOpClassToken)
OPDEF(MINT_LDTOKEN, "ldtoken", 2, MintOpClassToken) /* not really */
OPDEF(MINT_LDFTN, "ldftn", 2, MintOpMethodToken)
OPDEF(MINT_LDFTN_DYNAMIC, "ldftn.dynamic", 1, MintOpMethodToken)
OPDEF(MINT_LDVIRTFTN, "ldvirtftn", 2, MintOpMethodToken)
OPDEF(MINT_CPOBJ, "cpobj", 2, MintOpClassToken)
OPDEF(MINT_CPOBJ_VT, "cpobj.vt", 2, MintOpClassToken)
Expand Down
3 changes: 3 additions & 0 deletions mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,9 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoMeth
return TRUE;
}
#endif
} else if (in_corlib && !strcmp (klass_name_space, "System") && !strcmp (klass_name, "RuntimeMethodHandle") && !strcmp (tm, "GetFunctionPointer") && csignature->param_count == 1) {
// We must intrinsify this method on interp so we don't return a pointer to native code entering interpreter
*op = MINT_LDFTN_DYNAMIC;
}

return FALSE;
Expand Down