[interp] Simplify GetRawData (#44217)
authorVlad Brezae <brezaevlad@gmail.com>
Wed, 4 Nov 2020 07:09:25 +0000 (09:09 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Nov 2020 07:09:25 +0000 (09:09 +0200)
Generate also better code.

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

index a60eedb..f104dba 100644 (file)
@@ -1900,14 +1900,9 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
                        td->ip += 5;
                        return TRUE;
                } else if (!strcmp (tm, "GetRawData")) {
-#if SIZEOF_VOID_P == 8
-                       interp_add_ins (td, MINT_LDC_I8_S);
-#else
-                       interp_add_ins (td, MINT_LDC_I4_S);
-#endif
+                       interp_add_ins (td, MINT_LDFLDA_UNSAFE);
                        td->last_ins->data [0] = (gint16) MONO_ABI_SIZEOF (MonoObject);
 
-                       interp_add_ins (td, MINT_ADD_P);
                        SET_SIMPLE_TYPE (td->sp - 1, STACK_TYPE_MP);
 
                        td->ip += 5;