3643 // provoke OS NULL exception if reg = NULL by 3644 // accessing M[reg] w/o changing any (non-CC) registers 3645 // NOTE: cmpl is plenty here to provoke a segv 3646 cmpptr(rax, Address(reg, 0)); 3647 // Note: should probably use testl(rax, Address(reg, 0)); 3648 // may be shorter code (however, this version of 3649 // testl needs to be implemented first) 3650 } else { 3651 // nothing to do, (later) access of M[reg + offset] 3652 // will provoke OS NULL exception if reg = NULL 3653 } 3654 } 3655 3656 void MacroAssembler::os_breakpoint() { 3657 // instead of directly emitting a breakpoint, call os:breakpoint for better debugability 3658 // (e.g., MSVC can't call ps() otherwise) 3659 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 3660 } 3661 3662 void MacroAssembler::unimplemented(const char* what) { 3663 char* b = new char[1024]; 3664 jio_snprintf(b, 1024, "unimplemented: %s", what); 3665 stop(b); 3666 } 3667 3668 #ifdef _LP64 3669 #define XSTATE_BV 0x200 3670 #endif 3671 3672 void MacroAssembler::pop_CPU_state() { 3673 pop_FPU_state(); 3674 pop_IU_state(); 3675 } 3676 3677 void MacroAssembler::pop_FPU_state() { 3678 #ifndef _LP64 3679 frstor(Address(rsp, 0)); 3680 #else 3681 fxrstor(Address(rsp, 0)); 3682 #endif 3683 addptr(rsp, FPUStateSizeInWords * wordSize); 3684 } 3685 | 3643 // provoke OS NULL exception if reg = NULL by 3644 // accessing M[reg] w/o changing any (non-CC) registers 3645 // NOTE: cmpl is plenty here to provoke a segv 3646 cmpptr(rax, Address(reg, 0)); 3647 // Note: should probably use testl(rax, Address(reg, 0)); 3648 // may be shorter code (however, this version of 3649 // testl needs to be implemented first) 3650 } else { 3651 // nothing to do, (later) access of M[reg + offset] 3652 // will provoke OS NULL exception if reg = NULL 3653 } 3654 } 3655 3656 void MacroAssembler::os_breakpoint() { 3657 // instead of directly emitting a breakpoint, call os:breakpoint for better debugability 3658 // (e.g., MSVC can't call ps() otherwise) 3659 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 3660 } 3661 3662 void MacroAssembler::unimplemented(const char* what) { 3663 const char* buf = NULL; 3664 { 3665 ResourceMark rm; 3666 stringStream ss; 3667 ss.print("unimplemented: %s", what); 3668 buf = code_string(ss.as_string()); 3669 } 3670 stop(buf); 3671 } 3672 3673 #ifdef _LP64 3674 #define XSTATE_BV 0x200 3675 #endif 3676 3677 void MacroAssembler::pop_CPU_state() { 3678 pop_FPU_state(); 3679 pop_IU_state(); 3680 } 3681 3682 void MacroAssembler::pop_FPU_state() { 3683 #ifndef _LP64 3684 frstor(Address(rsp, 0)); 3685 #else 3686 fxrstor(Address(rsp, 0)); 3687 #endif 3688 addptr(rsp, FPUStateSizeInWords * wordSize); 3689 } 3690 |