Skip to content

Commit

Permalink
Add call to mono_jit_thread_attach in prolog when wrapping native to …
Browse files Browse the repository at this point in the history
…managed
  • Loading branch information
nealef committed Mar 22, 2011
1 parent e5ff6e6 commit f5d0b7c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion mono/mini/mini-s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -5095,9 +5095,30 @@ mono_arch_emit_prolog (MonoCompile *cfg)
pos++;
}

if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
if (cfg->compile_aot)
/* AOT code is only used in the root domain */
s390_lghi (code, s390_r2, 0);
else {
s390_basr(code, s390_r14, 0);
s390_j (code, 6);
s390_llong(code, cfg->domain);
s390_lg (code, s390_r2, 0, s390_r14, 4);
}

s390_basr(code, s390_r14, 0);
s390_j (code, 6);
mono_add_patch_info (cfg, code - cfg->native_code,
MONO_PATCH_INFO_INTERNAL_METHOD,
(gpointer)"mono_jit_thread_attach");
s390_llong(code, 0);
s390_lg (code, s390_r1, 0, s390_r14, 4);
s390_basr (code, s390_r14, s390_r1);
}

if (method->save_lmf) {
/*---------------------------------------------------------------*/
/* we build the MonoLMF structure on the stack - see mini-s390.h */
/* build the MonoLMF structure on the stack - see mini-s390x.h */
/*---------------------------------------------------------------*/
lmfOffset = alloc_size - sizeof(MonoLMF);

Expand Down

0 comments on commit f5d0b7c

Please sign in to comment.