gen_i2c_adapter problem on x86_64

Christian Thalinger Christian.Thalinger at Sun.COM
Tue Sep 8 01:36:47 PDT 2009

John Rose wrote:
> Probably it already works because r13 is part of the interpreter  
> calling convention, like rsi is on 32-bit.
> See InterpreterMacroAssembler::prepare_to_jump_from_interpreted on  
> both platforms.

The problem is that in gen_c2i_adapter we save the SP before extra space
is allocated on the stack to hold the arguments:

  int extraspace = (total_args_passed * Interpreter::stackElementSize())
+ wordSize;

  // stack is aligned, keep it that way
  extraspace = round_to(extraspace, 2*wordSize);

  // Get return address
  __ pop(rax);

  // set senderSP value
  __ mov(r13, rsp);

  __ subptr(rsp, extraspace);

and in gen_i2c_adapter we load the arguments relative to r13 (with
positive offsets).  This cannot work.  At least when we have a C2I-I2C
call path.

-- Christian

More information about the hotspot-compiler-dev mailing list