Question on TemplateTable::prepare_invoke

Christian Thalinger Christian.Thalinger at Sun.COM
Wed Mar 3 12:09:56 PST 2010


On Tue, 2010-03-02 at 23:24 -0600, Peng Du wrote:
> void TemplateTable::prepare_invoke(Register, Register, int) {
>   const Register recv   = rcx;
>   ...
>   // load receiver if needed (note: no return address pushed yet)
>   if (load_receiver) {
>     __ movl(recv, flags);
>     __ andl(recv, 0xFF);
>     if (TaggedStackInterpreter) __ shll(recv, 1);  // index*2
>     Address recv_addr(rsp, recv, Address::times_8,
> -Interpreter::expr_offset_in_bytes(1));
>     if (is_invokedynamic) {
>       __ lea(recv, recv_addr);
>     } else {
>       __ movptr(recv, recv_addr);
>       __ verify_oop(recv);
>     }        
>         
>     // !!! cache receiver object !!!
>     __ call_VM(noreg, CAST_FROM_FN_PTR(address, 
>         InterpreterRuntime::cache_object), recv);    
>   }
> ...

> Is it because I somehow clobber the recv (rcx) register?

It's very likely that you trash some registers during the call.  Try to
put pusha/popa around your call.

-- Christian



More information about the hotspot-dev mailing list