src/os_cpu/linux_x86/vm/os_linux_x86.cpp

Print this page
rev 3149 : 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
Summary: check stack alignment on VM entry on x64.
Reviewed-by:


 845   st->print("EAX="); print_location(st, uc->uc_mcontext.gregs[REG_EAX]);
 846   st->print("EBX="); print_location(st, uc->uc_mcontext.gregs[REG_EBX]);
 847   st->print("ECX="); print_location(st, uc->uc_mcontext.gregs[REG_ECX]);
 848   st->print("EDX="); print_location(st, uc->uc_mcontext.gregs[REG_EDX]);
 849   st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
 850   st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
 851   st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
 852   st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
 853 #endif // AMD64
 854 
 855   st->cr();
 856 }
 857 
 858 void os::setup_fpu() {
 859 #ifndef AMD64
 860   address fpu_cntrl = StubRoutines::addr_fpu_cntrl_wrd_std();
 861   __asm__ volatile (  "fldcw (%0)" :
 862                       : "r" (fpu_cntrl) : "memory");
 863 #endif // !AMD64
 864 }










 845   st->print("EAX="); print_location(st, uc->uc_mcontext.gregs[REG_EAX]);
 846   st->print("EBX="); print_location(st, uc->uc_mcontext.gregs[REG_EBX]);
 847   st->print("ECX="); print_location(st, uc->uc_mcontext.gregs[REG_ECX]);
 848   st->print("EDX="); print_location(st, uc->uc_mcontext.gregs[REG_EDX]);
 849   st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
 850   st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
 851   st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
 852   st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
 853 #endif // AMD64
 854 
 855   st->cr();
 856 }
 857 
 858 void os::setup_fpu() {
 859 #ifndef AMD64
 860   address fpu_cntrl = StubRoutines::addr_fpu_cntrl_wrd_std();
 861   __asm__ volatile (  "fldcw (%0)" :
 862                       : "r" (fpu_cntrl) : "memory");
 863 #endif // !AMD64
 864 }
 865 
 866 #ifndef PRODUCT
 867 void os::verify_stack_alignment() {
 868 #ifdef AMD64
 869   assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
 870 #endif
 871 }
 872 #endif