Skip to content

Commit 846f4ea

Browse files
committed
[mono][interp] Remove redundant check
If we are calling a method of a valuetype, then we already know `this` pointer is an instantiation of a valuetype.
1 parent 4516c27 commit 846f4ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mono/mono/mini/interp/interp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,7 +4003,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause
40034003
MonoObject *this_arg = del->target;
40044004

40054005
// replace the MonoDelegate* on the stack with 'this' pointer
4006-
if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (cmethod->method->klass)) {
4006+
if (m_class_is_valuetype (cmethod->method->klass)) {
40074007
gpointer unboxed = mono_object_unbox_internal (this_arg);
40084008
LOCAL_VAR (call_args_offset, gpointer) = unboxed;
40094009
} else {
@@ -4103,7 +4103,7 @@ mono_interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClause
41034103
ip += 5;
41044104
// FIXME push/pop LMF
41054105
cmethod = get_virtual_method_fast (cmethod, this_arg->vtable, slot);
4106-
if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (cmethod->method->klass)) {
4106+
if (m_class_is_valuetype (cmethod->method->klass)) {
41074107
/* unbox */
41084108
gpointer unboxed = mono_object_unbox_internal (this_arg);
41094109
LOCAL_VAR (call_args_offset, gpointer) = unboxed;

0 commit comments

Comments
 (0)