1.1 --- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Tue Oct 06 02:11:49 2009 -0700 1.2 +++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Tue Oct 06 10:15:38 2009 -0700 1.3 @@ -107,7 +107,7 @@ 1.4 // are saved in register windows - I's and L's in the caller's frame and O's in the stub frame 1.5 // (as the stub's I's) when the runtime routine called by the stub creates its frame. 1.6 int i; 1.7 - // Always make the frame size 16 bytr aligned. 1.8 + // Always make the frame size 16 byte aligned. 1.9 int frame_size = round_to(additional_frame_words + register_save_size, 16); 1.10 // OopMap frame size is in c2 stack slots (sizeof(jint)) not bytes or words 1.11 int frame_size_in_slots = frame_size / sizeof(jint); 1.12 @@ -201,15 +201,14 @@ 1.13 __ stx(G5, SP, ccr_offset+STACK_BIAS); 1.14 __ stxfsr(SP, fsr_offset+STACK_BIAS); 1.15 1.16 - // Save all the FP registers 1.17 + // Save all the FP registers: 32 doubles (32 floats correspond to the 2 halves of the first 16 doubles) 1.18 int offset = d00_offset; 1.19 - for( int i=0; i<64; i+=2 ) { 1.20 + for( int i=0; i<FloatRegisterImpl::number_of_registers; i+=2 ) { 1.21 FloatRegister f = as_FloatRegister(i); 1.22 __ stf(FloatRegisterImpl::D, f, SP, offset+STACK_BIAS); 1.23 + // Record as callee saved both halves of double registers (2 float registers). 1.24 map->set_callee_saved(VMRegImpl::stack2reg(offset>>2), f->as_VMReg()); 1.25 - if (true) { 1.26 - map->set_callee_saved(VMRegImpl::stack2reg((offset + sizeof(float))>>2), f->as_VMReg()->next()); 1.27 - } 1.28 + map->set_callee_saved(VMRegImpl::stack2reg((offset + sizeof(float))>>2), f->as_VMReg()->next()); 1.29 offset += sizeof(double); 1.30 } 1.31 1.32 @@ -224,7 +223,7 @@ 1.33 void RegisterSaver::restore_live_registers(MacroAssembler* masm) { 1.34 1.35 // Restore all the FP registers 1.36 - for( int i=0; i<64; i+=2 ) { 1.37 + for( int i=0; i<FloatRegisterImpl::number_of_registers; i+=2 ) { 1.38 __ ldf(FloatRegisterImpl::D, SP, d00_offset+i*sizeof(float)+STACK_BIAS, as_FloatRegister(i)); 1.39 } 1.40