2009/7/1 Arthur HUILLET <arthur.huil...@free.fr>:
> Hi,
>
>> +void emit_trace_invoke(struct buffer *buf,
>> +     const char *class, const char *method, const char *type)
>> +{
>> +     __emit_push_imm(buf, (unsigned long) type);
>> +     __emit_push_imm(buf, (unsigned long) method);
>> +     __emit_push_imm(buf, (unsigned long) class);
>> +     __emit_push_imm(buf, (unsigned long) "trace invoke: %s.%s%s\n");
>> +     __emit_call(buf, &printf);
>> +     __emit_add_imm_reg(buf, 16, REG_ESP);
>> +}
>
> This modifies %eax and the register allocator is not aware of it.
>
> However since you emit that at the beginning of a method, and %eax is a
> scratch register (caller saved), things should be fine. Lucky boy :)

Hehe, yes, I was hoping for something like that! ;-)

>
>> +void emit_trace_invoke(struct buffer *buf,
>> +     const char *class, const char *method, const char *type)
>> +{
>> +     __emit_push_imm(buf, (unsigned long) type);
>> +     __emit_push_imm(buf, (unsigned long) method);
>> +     __emit_push_imm(buf, (unsigned long) class);
>> +     __emit_push_imm(buf, (unsigned long) "trace invoke: %s.%s%s\n");
>> +     __emit_call(buf, &printf);
>> +     __emit_add_imm_reg(buf, 32, REG_RSP);
>> +}
>
> Aren't you redefining the function here? Does it build?

Yes, this is the x86_64 part. Notice we add 32 to %rsp instead of 16 to %esp.

>
> Reviewed-By: Arthur Huillet

Thanks for the review!


Vegard

------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to