JDK-6326417 : call_VM doesn't allocate enough backing stack space for register argument on Win64
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2_11,5.0u7,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-09-20
  • Updated: 2014-02-24
  • Resolved: 2006-01-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_12Resolved
Description
This is a bug fix in mustang that missed being backported to tiger.

Here is an example of the mustang code:

void MacroAssembler::call_VM_leaf_base(address entry_point, int num_args)
{
  Label L, E;

#ifdef _WIN64
  // Windows always allocates space for it's register args
  assert(num_args <= 4, "only register arguments supported");
  subq(rsp,  frame::arg_reg_save_area_bytes);
#endif
...

and the tiger code:
void MacroAssembler::call_VM_leaf_base(address entry_point, int num_args)
{
  Label L, E;

#ifdef _WIN64
    // Windows always allocates space for it's register args
    subq(rsp, (num_args+1)*wordSize);
#endif

Comments
EVALUATION The fix can be backported easily.
21-10-2005

SUGGESTED FIX here are diffs for the fix as applied to 1.4.2 *** 5617,5627 **** void MacroAssembler::call_VM_leaf_base(address entry_point, int num_args) { Label L, E; #ifdef _WIN64 // Windows always allocates space for it's register args ! subq(rsp, (num_args+1)*wordSize); #endif // Align stack if necessary testl(rsp, 15); jcc(Assembler::zero, L); --- 5617,5627 ---- void MacroAssembler::call_VM_leaf_base(address entry_point, int num_args) { Label L, E; #ifdef _WIN64 // Windows always allocates space for it's register args ! subq(rsp, frame::arg_reg_save_area_bytes); #endif // Align stack if necessary testl(rsp, 15); jcc(Assembler::zero, L); *** 5636,5646 **** bind(E); #ifdef _WIN64 // restore stack pointer ! addq(rsp, (num_args+1)*wordSize); #endif } --- 5636,5646 ---- bind(E); #ifdef _WIN64 // restore stack pointer ! addq(rsp, frame::arg_reg_save_area_bytes); #endif } *** 5673,5683 **** Label L, E; // Align stack if necessary #ifdef _WIN64 // Windows always allocates space for it's register args ! subq(rsp, (num_args+1)*wordSize); #endif testl(rsp, 15); jcc(Assembler::zero, L); subq(rsp, 8); --- 5673,5683 ---- Label L, E; // Align stack if necessary #ifdef _WIN64 // Windows always allocates space for it's register args ! subq(rsp, frame::arg_reg_save_area_bytes); #endif testl(rsp, 15); jcc(Assembler::zero, L); subq(rsp, 8); *** 5690,5700 **** bind(E); #ifdef _WIN64 // restore stack pointer ! addq(rsp, (num_args+1)*wordSize); #endif } #ifdef ASSERT pushq(rax); --- 5690,5700 ---- bind(E); #ifdef _WIN64 // restore stack pointer ! addq(rsp, frame::arg_reg_save_area_bytes); #endif } #ifdef ASSERT pushq(rax);
20-09-2005