stmt: OP_NOT_REACHED {
}
+stmt: OP_MEMORY_BARRIER {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
#
# load/store operations
#
mono_bblock_add_inst (s->cbb, tree);
}
-stmt: CEE_SWITCH (reg) {
+stmt: CEE_SWITCH (reg) "2" {
MonoInst *label;
int offset_reg = mono_regstate_next_int (s->rs);
int target_reg = mono_regstate_next_int (s->rs);
/* 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 */
}
void
-mini_emit_memset (MonoCompile *s, int destreg, int offset, int size, int val, int alignl)
+mini_emit_memset (MonoCompile *s, int destreg, int offset, int size, int val, int align)
{
int val_reg = mono_regstate_next_int (s->rs);
else
MONO_EMIT_NEW_ICONST (s, val_reg, val);
+ /* FIXME: consider alignment for archs that need it. */
+#if !NO_UNALIGNED_ACCESS
if (sizeof (gpointer) == 8) {
+ if (offset % 8) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 4;
+ size -= 4;
+ }
while (size >= 8) {
MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI8_MEMBASE_REG, destreg, offset, val_reg);
offset += 8;
size -= 8;
}
}
+#endif
while (size >= 4) {
MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, destreg, offset, val_reg);