Skip to content

Commit

Permalink
Add a missing wbarrier to the gsharedvt code.
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz committed May 6, 2013
1 parent 3f3092b commit 59c840b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mono/mini/method-to-ir.c
Expand Up @@ -2897,7 +2897,7 @@ mini_emit_stobj (MonoCompile *cfg, MonoInst *dest, MonoInst *src, MonoClass *kla
n = mono_class_value_size (klass, &align);

/* if native is true there should be no references in the struct */
if (cfg->gen_write_barriers && klass->has_references && !native) {
if (cfg->gen_write_barriers && (klass->has_references || size_ins) && !native) {
/* Avoid barriers when storing to the stack */
if (!((dest->opcode == OP_ADD_IMM && dest->sreg1 == cfg->frame_reg) ||
(dest->opcode == OP_LDADDR))) {
Expand Down Expand Up @@ -9491,8 +9491,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
offset_ins = emit_get_rgctx_field (cfg, context_used, field, MONO_RGCTX_INFO_FIELD_OFFSET);
dreg = alloc_ireg_mp (cfg);
EMIT_NEW_BIALU (cfg, ins, OP_PADD, dreg, sp [0]->dreg, offset_ins->dreg);
/* The decomposition will call mini_emit_stobj () which will emit a wbarrier if needed */
EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, field->type, dreg, 0, sp [1]->dreg);
// FIXME-VT: wbarriers ?
} else {
EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, field->type, sp [0]->dreg, foffset, sp [1]->dreg);
}
Expand Down

0 comments on commit 59c840b

Please sign in to comment.