Index: vm/gc_gen/src/common/gc_for_barrier.cpp =================================================================== --- vm/gc_gen/src/common/gc_for_barrier.cpp (revision 616226) +++ vm/gc_gen/src/common/gc_for_barrier.cpp (working copy) @@ -259,17 +259,20 @@ } /* FIXME:: this is not the right interface for write barrier */ -void gc_heap_slot_write_ref (Managed_Object_Handle p_obj_holding_ref,Managed_Object_Handle *p_slot, Managed_Object_Handle p_target) +void __stdcall gc_heap_slot_write_ref (Managed_Object_Handle p_obj_holding_ref,Managed_Object_Handle *_p_slot, Managed_Object_Handle p_target) { + REF* p_slot = (REF*)_p_slot; Mutator *mutator = (Mutator *)gc_get_tls(); mutator_post_signal(mutator,MUTATOR_ENTER_BARRIER); switch(write_barrier_function){ case WRITE_BARRIER_REM_NIL: - *p_slot = p_target; + write_slot(p_slot, (Partial_Reveal_Object*)p_target); + //*p_slot = p_target; break; case WRITE_BARRIER_REM_SOURCE_REF: - *p_slot = p_target; + //*p_slot = p_target; + write_slot(p_slot, (Partial_Reveal_Object*)p_target); #ifdef USE_REM_SLOTS gen_write_barrier_rem_slot(p_slot, p_target); #else /* USE_REM_OBJS */ @@ -277,16 +280,19 @@ #endif break; case WRITE_BARRIER_REM_SOURCE_OBJ: - *p_slot = p_target; + //*p_slot = p_target; + write_slot(p_slot, (Partial_Reveal_Object*)p_target); write_barrier_rem_source_obj(p_obj_holding_ref); break; case WRITE_BARRIER_REM_OBJ_SNAPSHOT: write_barrier_rem_obj_snapshot(p_obj_holding_ref); - *p_slot = p_target; + //*p_slot = p_target; + write_slot(p_slot, (Partial_Reveal_Object*)p_target); break; case WRITE_BARRIER_REM_OLD_VAR: - write_barrier_rem_slot_oldvar(p_slot); - *p_slot = p_target; + write_barrier_rem_slot_oldvar(_p_slot); + //*p_slot = p_target; + write_slot(p_slot, (Partial_Reveal_Object*)p_target); break; default: assert(0); Index: vm/vmcore/src/jit/rt_helper_info.cpp =================================================================== --- vm/vmcore/src/jit/rt_helper_info.cpp (revision 616226) +++ vm/vmcore/src/jit/rt_helper_info.cpp (working copy) @@ -138,7 +138,7 @@ NULL, NULL, NULL, NULL}, {VM_RT_GC_HEAP_WRITE_REF, "VM_RT_GC_HEAP_WRITE_REF", - INTERRUPTIBLE_NEVER, CALLING_CONVENTION_CDECL, 3, + INTERRUPTIBLE_NEVER, CALLING_CONVENTION_STDCALL, 3, NULL, NULL, "(Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;Lorg/vmmagic/unboxed/Address;)V", NULL}, {VM_RT_GC_SAFE_POINT, "VM_RT_GC_SAFE_POINT", INTERRUPTIBLE_ALWAYS, CALLING_CONVENTION_STDCALL, 0, Index: vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp =================================================================== --- vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (revision 616226) +++ vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (working copy) @@ -349,6 +349,8 @@ // Array creation helper case VM_RT_NEW_VECTOR_USING_VTABLE: return rth_get_lil_new_vector_using_vtable(); + case VM_RT_GC_HEAP_WRITE_REF: + return (void*)gc_heap_slot_write_ref; default: ASSERT(false, "Unexpected helper id" << f); return NULL; Index: vm/jitrino/src/jet/cg_meth.cpp =================================================================== --- vm/jitrino/src/jet/cg_meth.cpp (revision 616226) +++ vm/jitrino/src/jet/cg_meth.cpp (working copy) @@ -923,7 +923,7 @@ if (args[i] == 0) { break; } - rlock(*args[0]); + rlock(*args[i]); } // 2nd, generate moves for (unsigned i=0; i