3711 // Test below is ordered based on the relative positions of 3712 // the Java heap and the VTBuffer to execute a single test for heap-allocated values 3713 3714 if (VTBuffer::base() < Universe::heap()->base()) { 3715 lea(temp_reg, VTBuffer_end); 3716 cmpptr(value, temp_reg); 3717 jcc(Assembler::greaterEqual, not_buffered); 3718 lea(temp_reg, VTBuffer_top); 3719 cmpptr(value, temp_reg); 3720 jcc(Assembler::less, not_buffered); 3721 } else { 3722 lea(temp_reg, VTBuffer_top); 3723 cmpptr(value, temp_reg); 3724 jcc(Assembler::less, not_buffered); 3725 lea(temp_reg, VTBuffer_end); 3726 cmpptr(value, temp_reg); 3727 jcc(Assembler::greaterEqual, not_buffered); 3728 } 3729 } 3730 3731 void MacroAssembler::os_breakpoint() { 3732 // instead of directly emitting a breakpoint, call os:breakpoint for better debugability 3733 // (e.g., MSVC can't call ps() otherwise) 3734 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 3735 } 3736 3737 void MacroAssembler::unimplemented(const char* what) { 3738 const char* buf = NULL; 3739 { 3740 ResourceMark rm; 3741 stringStream ss; 3742 ss.print("unimplemented: %s", what); 3743 buf = code_string(ss.as_string()); 3744 } 3745 stop(buf); 3746 } 3747 3748 #ifdef _LP64 3749 #define XSTATE_BV 0x200 3750 #endif | 3711 // Test below is ordered based on the relative positions of 3712 // the Java heap and the VTBuffer to execute a single test for heap-allocated values 3713 3714 if (VTBuffer::base() < Universe::heap()->base()) { 3715 lea(temp_reg, VTBuffer_end); 3716 cmpptr(value, temp_reg); 3717 jcc(Assembler::greaterEqual, not_buffered); 3718 lea(temp_reg, VTBuffer_top); 3719 cmpptr(value, temp_reg); 3720 jcc(Assembler::less, not_buffered); 3721 } else { 3722 lea(temp_reg, VTBuffer_top); 3723 cmpptr(value, temp_reg); 3724 jcc(Assembler::less, not_buffered); 3725 lea(temp_reg, VTBuffer_end); 3726 cmpptr(value, temp_reg); 3727 jcc(Assembler::greaterEqual, not_buffered); 3728 } 3729 } 3730 3731 void MacroAssembler::test_oop_is_value(Register oop, Register temp, Label* is_value, Label* is_not_value) { 3732 const int mask = Universe::oop_metadata_valuetype_mask(); 3733 assert((is_value != NULL) || (is_not_value != NULL), "Need a label to jump to"); 3734 assert((is_value == NULL) ^ (is_not_value == NULL), "Need one label"); 3735 #ifdef _LP64 3736 if (UseCompressedClassPointers) { 3737 movl(temp, Address(oop, oopDesc::klass_offset_in_bytes())); 3738 } else 3739 #endif 3740 movptr(temp, Address(oop, oopDesc::klass_offset_in_bytes())); 3741 3742 andl(temp, mask); 3743 testl(temp, temp); 3744 if (is_not_value != NULL) { 3745 jcc(Assembler::zero, *is_not_value); 3746 } else { 3747 jcc(Assembler::notZero, *is_value); 3748 } 3749 } 3750 3751 void MacroAssembler::os_breakpoint() { 3752 // instead of directly emitting a breakpoint, call os:breakpoint for better debugability 3753 // (e.g., MSVC can't call ps() otherwise) 3754 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 3755 } 3756 3757 void MacroAssembler::unimplemented(const char* what) { 3758 const char* buf = NULL; 3759 { 3760 ResourceMark rm; 3761 stringStream ss; 3762 ss.print("unimplemented: %s", what); 3763 buf = code_string(ss.as_string()); 3764 } 3765 stop(buf); 3766 } 3767 3768 #ifdef _LP64 3769 #define XSTATE_BV 0x200 3770 #endif |