/* the object_is_null target simply copies the input register to the output */
mini_emit_isninst_cast (s, eclass_reg, klass->cast_class, false_label, object_is_null);
}
+ } else if (mono_class_is_nullable (klass)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+ /* the object_is_null target simply copies the input register to the output */
+ mini_emit_isninst_cast (s, klass_reg, klass->cast_class, false_label, object_is_null);
} else {
if (!s->compile_aot && !(s->opt & MONO_OPT_SHARED) && (klass->flags & TYPE_ATTRIBUTE_SEALED)) {
/* the remoting code is broken, access the class for now */
MONO_EMIT_NEW_COND_EXC (s, EQ, "InvalidCastException");
}
-static int
-size_to_load_u_membase (int size)
-{
- switch (size) {
- case 1:
- return OP_LOADU1_MEMBASE;
- case 2:
- return OP_LOADU2_MEMBASE;
- case 4:
- return OP_LOADU4_MEMBASE;
- case 8:
- return OP_LOADI8_MEMBASE;
- default:
- g_assert_not_reached ();
- return -1;
- }
-}
-
-static int
-size_to_store_membase_reg (int size)
-{
- switch (size) {
- case 1:
- return OP_STOREI1_MEMBASE_REG;
- case 2:
- return OP_STOREI2_MEMBASE_REG;
- case 4:
- return OP_STOREI4_MEMBASE_REG;
- case 8:
- return OP_STOREI8_MEMBASE_REG;
- default:
- g_assert_not_reached ();
- return -1;
- }
-}
-
void
mini_emit_memcpy (MonoCompile *s, int destreg, int doffset, int srcreg, int soffset, int size, int align)
{