293 294 // Pop all of the register save are off the stack except the return address 295 __ addptr(rsp, return_offset_in_bytes()); 296 } 297 298 // The java_calling_convention describes stack locations as ideal slots on 299 // a frame with no abi restrictions. Since we must observe abi restrictions 300 // (like the placement of the register window) the slots must be biased by 301 // the following value. 302 static int reg2offset_in(VMReg r) { 303 // Account for saved rbp and return address 304 // This should really be in_preserve_stack_slots 305 return (r->reg2stack() + 4) * VMRegImpl::stack_slot_size; 306 } 307 308 static int reg2offset_out(VMReg r) { 309 return (r->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size; 310 } 311 312 // --------------------------------------------------------------------------- 313 // Read the array of BasicTypes from a signature, and compute where the 314 // arguments should go. Values in the VMRegPair regs array refer to 4-byte 315 // quantities. Values less than VMRegImpl::stack0 are registers, those above 316 // refer to 4-byte stack slots. All stack slots are based off of the stack pointer 317 // as framesizes are fixed. 318 // VMRegImpl::stack0 refers to the first slot 0(sp). 319 // and VMRegImpl::stack0+1 refers to the memory word 4-byes higher. Register 320 // up to RegisterImpl::number_of_registers) are the 64-bit 321 // integer registers. 322 323 // Note: the INPUTS in sig_bt are in units of Java argument words, which are 324 // either 32-bit or 64-bit depending on the build. The OUTPUTS are in 32-bit 325 // units regardless of build. Of course for i486 there is no 64 bit build 326 327 // The Java calling convention is a "shifted" version of the C ABI. 328 // By skipping the first C ABI register we can call non-static jni methods 329 // with small numbers of arguments without having to shuffle the arguments 330 // at all. Since we control the java ABI we ought to at least get some 331 // advantage out of it. 332 | 293 294 // Pop all of the register save are off the stack except the return address 295 __ addptr(rsp, return_offset_in_bytes()); 296 } 297 298 // The java_calling_convention describes stack locations as ideal slots on 299 // a frame with no abi restrictions. Since we must observe abi restrictions 300 // (like the placement of the register window) the slots must be biased by 301 // the following value. 302 static int reg2offset_in(VMReg r) { 303 // Account for saved rbp and return address 304 // This should really be in_preserve_stack_slots 305 return (r->reg2stack() + 4) * VMRegImpl::stack_slot_size; 306 } 307 308 static int reg2offset_out(VMReg r) { 309 return (r->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size; 310 } 311 312 // --------------------------------------------------------------------------- 313 // This method is used to read a float value which is saved on stack as double 314 // (see RegisterSaver::save_live_registers() above). 315 StackValue* StackValue::create_float_stack_value(address value_addr) { 316 union { intptr_t p; jfloat jf; } value; 317 value.p = (intptr_t) CONST64(0xDEADDEAFDEADDEAF); 318 // XMM registers are used for float values and they are saved as double 319 // without conversion. Read lowest 32 bit to get float value. 320 value.jf = *(jfloat*) value_addr; 321 return new StackValue(value.p); // 64-bit high half is stack junk 322 } 323 324 // --------------------------------------------------------------------------- 325 // Read the array of BasicTypes from a signature, and compute where the 326 // arguments should go. Values in the VMRegPair regs array refer to 4-byte 327 // quantities. Values less than VMRegImpl::stack0 are registers, those above 328 // refer to 4-byte stack slots. All stack slots are based off of the stack pointer 329 // as framesizes are fixed. 330 // VMRegImpl::stack0 refers to the first slot 0(sp). 331 // and VMRegImpl::stack0+1 refers to the memory word 4-byes higher. Register 332 // up to RegisterImpl::number_of_registers) are the 64-bit 333 // integer registers. 334 335 // Note: the INPUTS in sig_bt are in units of Java argument words, which are 336 // either 32-bit or 64-bit depending on the build. The OUTPUTS are in 32-bit 337 // units regardless of build. Of course for i486 there is no 64 bit build 338 339 // The Java calling convention is a "shifted" version of the C ABI. 340 // By skipping the first C ABI register we can call non-static jni methods 341 // with small numbers of arguments without having to shuffle the arguments 342 // at all. Since we control the java ABI we ought to at least get some 343 // advantage out of it. 344 |