comparison src/cpu/x86/vm/assembler_x86.cpp @ 1976:0fc262af204f

6780143: hs203t003 hits SIGSEGV/EXCEPTION_ACCESS_VIOLATION with -XX:+UseCompressedOops Summary: Using r12 as temporary register around call_VM trashes heapbase becausecall_VM doesn't always return immediately to following code (eg forward_exception, popframe and early return support). Reviewed-by: never, kvn
author coleenp
date Mon, 29 Nov 2010 15:43:36 -0500
parents f95d63e2154a
children 4de5f4101cfd
comparison
equal deleted inserted replaced
1972:f95d63e2154a 1976:0fc262af204f
5536 call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug64))); 5536 call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug64)));
5537 hlt(); 5537 hlt();
5538 } 5538 }
5539 5539
5540 void MacroAssembler::warn(const char* msg) { 5540 void MacroAssembler::warn(const char* msg) {
5541 push(r12); 5541 push(rsp);
5542 movq(r12, rsp);
5543 andq(rsp, -16); // align stack as required by push_CPU_state and call 5542 andq(rsp, -16); // align stack as required by push_CPU_state and call
5544 5543
5545 push_CPU_state(); // keeps alignment at 16 bytes 5544 push_CPU_state(); // keeps alignment at 16 bytes
5546 lea(c_rarg0, ExternalAddress((address) msg)); 5545 lea(c_rarg0, ExternalAddress((address) msg));
5547 call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0); 5546 call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0);
5548 pop_CPU_state(); 5547 pop_CPU_state();
5549 5548 pop(rsp);
5550 movq(rsp, r12);
5551 pop(r12);
5552 } 5549 }
5553 5550
5554 #ifndef PRODUCT 5551 #ifndef PRODUCT
5555 extern "C" void findpc(intptr_t x); 5552 extern "C" void findpc(intptr_t x);
5556 #endif 5553 #endif
5858 last_java_sp = rsp; 5855 last_java_sp = rsp;
5859 } 5856 }
5860 // debugging support 5857 // debugging support
5861 assert(number_of_arguments >= 0 , "cannot have negative number of arguments"); 5858 assert(number_of_arguments >= 0 , "cannot have negative number of arguments");
5862 LP64_ONLY(assert(java_thread == r15_thread, "unexpected register")); 5859 LP64_ONLY(assert(java_thread == r15_thread, "unexpected register"));
5860 #ifdef ASSERT
5861 LP64_ONLY(if (UseCompressedOops) verify_heapbase("call_VM_base");)
5862 #endif // ASSERT
5863
5863 assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result"); 5864 assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result");
5864 assert(java_thread != last_java_sp, "cannot use the same register for java_thread & last_java_sp"); 5865 assert(java_thread != last_java_sp, "cannot use the same register for java_thread & last_java_sp");
5865 5866
5866 // push java thread (becomes first argument of C function) 5867 // push java thread (becomes first argument of C function)
5867 5868