[Mono-dev] Where is trampoline x86 pseudo code documented?
cpMon
page.cal at gmail.com
Sat Mar 6 04:21:51 EST 2010
Is there a document that describes the x86 pseudo code your JIT engine uses.
For example, it would be a lot easier for me to find bugs for you if I
didn't have to reverse-engineer things such as:
Thanks,
Cal Page
if ( 0 && mono_thread_get_tls_offset () != -1) {
/* MonoObject* obj is in EAX */
/* is obj null? */
x86_test_reg_reg (buf, X86_EAX, X86_EAX);
/* if yes, jump to actual trampoline */
jump_obj_null = buf;
x86_branch8 (buf, X86_CC_Z, -1, 1);
/* load obj->synchronization to ECX */
x86_mov_reg_membase (buf, X86_ECX, X86_EAX, G_STRUCT_OFFSET
(MonoObject, synchronisation), 4);
/* is synchronization null? */
x86_test_reg_reg (buf, X86_ECX, X86_ECX);
/* if not, jump to next case */
jump_next = buf;
x86_branch8 (buf, X86_CC_NZ, -1, 1);
/* if yes, just return */
x86_ret (buf);
/* next case: synchronization is not null */
x86_patch (jump_next, buf);
/* load MonoThread* into EDX */
buf = mono_x86_emit_tls_get (buf, X86_EDX,
mono_thread_get_tls_offset ());
/* load TID into EDX */
x86_mov_reg_membase (buf, X86_EDX, X86_EDX, G_STRUCT_OFFSET
(MonoThread, tid), 4);
/* is synchronization->owner == TID */
x86_alu_membase_reg (buf, X86_CMP, X86_ECX, owner_offset,
X86_EDX);
/* if yes, jump to next case */
jump_next = buf;
x86_branch8 (buf, X86_CC_Z, -1, 1);
/* if not, just return */
x86_ret (buf);
/* next case: synchronization->owner == TID */
759,2-16 92%
--
View this message in context: http://n4.nabble.com/Where-is-trampoline-x86-pseudo-code-documented-tp1582713p1582713.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
More information about the Mono-devel-list
mailing list