comparison src/cpu/x86/vm/templateTable_x86_64.cpp @ 5995:19e197e2a1af

7158988: jvm crashes while debugging on x86_32 and x86_64 Summary: Object pointer is pushed more than once on stack, where GC doesn't expect it. Reviewed-by: coleenp, kvn Contributed-by: axel.siebenborn@sap.com
author coleenp
date Thu, 05 Apr 2012 12:17:52 -0400
parents 22cee0ee8927
children 1d7922586cf6
comparison
equal deleted inserted replaced
5983:749b1464aa81 5995:19e197e2a1af
2683 __ testl(c_rarg3, c_rarg3); 2683 __ testl(c_rarg3, c_rarg3);
2684 __ jcc(Assembler::zero, L2); 2684 __ jcc(Assembler::zero, L2);
2685 __ pop_ptr(rbx); // copy the object pointer from tos 2685 __ pop_ptr(rbx); // copy the object pointer from tos
2686 __ verify_oop(rbx); 2686 __ verify_oop(rbx);
2687 __ push_ptr(rbx); // put the object pointer back on tos 2687 __ push_ptr(rbx); // put the object pointer back on tos
2688 __ subptr(rsp, sizeof(jvalue)); // add space for a jvalue object 2688 // Save tos values before call_VM() clobbers them. Since we have
2689 __ mov(c_rarg3, rsp); 2689 // to do it for every data type, we use the saved values as the
2690 const Address field(c_rarg3, 0); 2690 // jvalue object.
2691
2692 switch (bytecode()) { // load values into the jvalue object 2691 switch (bytecode()) { // load values into the jvalue object
2693 case Bytecodes::_fast_aputfield: __ movq(field, rax); break; 2692 case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
2694 case Bytecodes::_fast_lputfield: __ movq(field, rax); break; 2693 case Bytecodes::_fast_bputfield: // fall through
2695 case Bytecodes::_fast_iputfield: __ movl(field, rax); break;
2696 case Bytecodes::_fast_bputfield: __ movb(field, rax); break;
2697 case Bytecodes::_fast_sputfield: // fall through 2694 case Bytecodes::_fast_sputfield: // fall through
2698 case Bytecodes::_fast_cputfield: __ movw(field, rax); break; 2695 case Bytecodes::_fast_cputfield: // fall through
2699 case Bytecodes::_fast_fputfield: __ movflt(field, xmm0); break; 2696 case Bytecodes::_fast_iputfield: __ push_i(rax); break;
2700 case Bytecodes::_fast_dputfield: __ movdbl(field, xmm0); break; 2697 case Bytecodes::_fast_dputfield: __ push_d(); break;
2698 case Bytecodes::_fast_fputfield: __ push_f(); break;
2699 case Bytecodes::_fast_lputfield: __ push_l(rax); break;
2700
2701 default: 2701 default:
2702 ShouldNotReachHere(); 2702 ShouldNotReachHere();
2703 } 2703 }
2704 2704 __ mov(c_rarg3, rsp); // points to jvalue on the stack
2705 // Save rax because call_VM() will clobber it, then use it for
2706 // JVMTI purposes
2707 __ push(rax);
2708 // access constant pool cache entry 2705 // access constant pool cache entry
2709 __ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1); 2706 __ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1);
2710 __ verify_oop(rbx); 2707 __ verify_oop(rbx);
2711 // rbx: object pointer copied above 2708 // rbx: object pointer copied above
2712 // c_rarg2: cache entry pointer 2709 // c_rarg2: cache entry pointer
2713 // c_rarg3: jvalue object on the stack 2710 // c_rarg3: jvalue object on the stack
2714 __ call_VM(noreg, 2711 __ call_VM(noreg,
2715 CAST_FROM_FN_PTR(address, 2712 CAST_FROM_FN_PTR(address,
2716 InterpreterRuntime::post_field_modification), 2713 InterpreterRuntime::post_field_modification),
2717 rbx, c_rarg2, c_rarg3); 2714 rbx, c_rarg2, c_rarg3);
2718 __ pop(rax); // restore lower value 2715
2719 __ addptr(rsp, sizeof(jvalue)); // release jvalue object space 2716 switch (bytecode()) { // restore tos values
2717 case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
2718 case Bytecodes::_fast_bputfield: // fall through
2719 case Bytecodes::_fast_sputfield: // fall through
2720 case Bytecodes::_fast_cputfield: // fall through
2721 case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
2722 case Bytecodes::_fast_dputfield: __ pop_d(); break;
2723 case Bytecodes::_fast_fputfield: __ pop_f(); break;
2724 case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
2725 }
2720 __ bind(L2); 2726 __ bind(L2);
2721 } 2727 }
2722 } 2728 }
2723 2729
2724 void TemplateTable::fast_storefield(TosState state) { 2730 void TemplateTable::fast_storefield(TosState state) {