1.1 --- a/src/cpu/x86/vm/templateTable_x86_64.cpp Sun Apr 01 17:04:26 2012 -0400 1.2 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp Thu Apr 05 12:17:52 2012 -0400 1.3 @@ -2685,26 +2685,23 @@ 1.4 __ pop_ptr(rbx); // copy the object pointer from tos 1.5 __ verify_oop(rbx); 1.6 __ push_ptr(rbx); // put the object pointer back on tos 1.7 - __ subptr(rsp, sizeof(jvalue)); // add space for a jvalue object 1.8 - __ mov(c_rarg3, rsp); 1.9 - const Address field(c_rarg3, 0); 1.10 - 1.11 + // Save tos values before call_VM() clobbers them. Since we have 1.12 + // to do it for every data type, we use the saved values as the 1.13 + // jvalue object. 1.14 switch (bytecode()) { // load values into the jvalue object 1.15 - case Bytecodes::_fast_aputfield: __ movq(field, rax); break; 1.16 - case Bytecodes::_fast_lputfield: __ movq(field, rax); break; 1.17 - case Bytecodes::_fast_iputfield: __ movl(field, rax); break; 1.18 - case Bytecodes::_fast_bputfield: __ movb(field, rax); break; 1.19 + case Bytecodes::_fast_aputfield: __ push_ptr(rax); break; 1.20 + case Bytecodes::_fast_bputfield: // fall through 1.21 case Bytecodes::_fast_sputfield: // fall through 1.22 - case Bytecodes::_fast_cputfield: __ movw(field, rax); break; 1.23 - case Bytecodes::_fast_fputfield: __ movflt(field, xmm0); break; 1.24 - case Bytecodes::_fast_dputfield: __ movdbl(field, xmm0); break; 1.25 + case Bytecodes::_fast_cputfield: // fall through 1.26 + case Bytecodes::_fast_iputfield: __ push_i(rax); break; 1.27 + case Bytecodes::_fast_dputfield: __ push_d(); break; 1.28 + case Bytecodes::_fast_fputfield: __ push_f(); break; 1.29 + case Bytecodes::_fast_lputfield: __ push_l(rax); break; 1.30 + 1.31 default: 1.32 ShouldNotReachHere(); 1.33 } 1.34 - 1.35 - // Save rax because call_VM() will clobber it, then use it for 1.36 - // JVMTI purposes 1.37 - __ push(rax); 1.38 + __ mov(c_rarg3, rsp); // points to jvalue on the stack 1.39 // access constant pool cache entry 1.40 __ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1); 1.41 __ verify_oop(rbx); 1.42 @@ -2715,8 +2712,17 @@ 1.43 CAST_FROM_FN_PTR(address, 1.44 InterpreterRuntime::post_field_modification), 1.45 rbx, c_rarg2, c_rarg3); 1.46 - __ pop(rax); // restore lower value 1.47 - __ addptr(rsp, sizeof(jvalue)); // release jvalue object space 1.48 + 1.49 + switch (bytecode()) { // restore tos values 1.50 + case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break; 1.51 + case Bytecodes::_fast_bputfield: // fall through 1.52 + case Bytecodes::_fast_sputfield: // fall through 1.53 + case Bytecodes::_fast_cputfield: // fall through 1.54 + case Bytecodes::_fast_iputfield: __ pop_i(rax); break; 1.55 + case Bytecodes::_fast_dputfield: __ pop_d(); break; 1.56 + case Bytecodes::_fast_fputfield: __ pop_f(); break; 1.57 + case Bytecodes::_fast_lputfield: __ pop_l(rax); break; 1.58 + } 1.59 __ bind(L2); 1.60 } 1.61 }