658 __ pushf();
659 __ incrementl(ExternalAddress((address) StubRoutines::verify_oop_count_addr()));
660 __ push(rdx); // save rdx
661 // make sure object is 'reasonable'
662 __ movptr(rax, Address(rsp, 4 * wordSize)); // get object
663 __ testptr(rax, rax);
664 __ jcc(Assembler::zero, exit); // if obj is NULL it is ok
665
666 // Check if the oop is in the right area of memory
667 const int oop_mask = Universe::verify_oop_mask();
668 const int oop_bits = Universe::verify_oop_bits();
669 __ mov(rdx, rax);
670 __ andptr(rdx, oop_mask);
671 __ cmpptr(rdx, oop_bits);
672 __ jcc(Assembler::notZero, error);
673
674 // make sure klass is 'reasonable', which is not zero.
675 __ movptr(rax, Address(rax, oopDesc::klass_offset_in_bytes())); // get klass
676 __ testptr(rax, rax);
677 __ jcc(Assembler::zero, error); // if klass is NULL it is broken
678 // TODO: Future assert that klass is lower 4g memory for UseCompressedKlassPointers
679
680 // return if everything seems ok
681 __ bind(exit);
682 __ movptr(rax, Address(rsp, 5 * wordSize)); // get saved rax, back
683 __ pop(rdx); // restore rdx
684 __ popf(); // restore EFLAGS
685 __ ret(3 * wordSize); // pop arguments
686
687 // handle errors
688 __ bind(error);
689 __ movptr(rax, Address(rsp, 5 * wordSize)); // get saved rax, back
690 __ pop(rdx); // get saved rdx back
691 __ popf(); // get saved EFLAGS off stack -- will be ignored
692 __ pusha(); // push registers (eip = return address & msg are already pushed)
693 BLOCK_COMMENT("call MacroAssembler::debug");
694 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug32)));
695 __ popa();
696 __ ret(3 * wordSize); // pop arguments
697 return start;
698 }
|
658 __ pushf();
659 __ incrementl(ExternalAddress((address) StubRoutines::verify_oop_count_addr()));
660 __ push(rdx); // save rdx
661 // make sure object is 'reasonable'
662 __ movptr(rax, Address(rsp, 4 * wordSize)); // get object
663 __ testptr(rax, rax);
664 __ jcc(Assembler::zero, exit); // if obj is NULL it is ok
665
666 // Check if the oop is in the right area of memory
667 const int oop_mask = Universe::verify_oop_mask();
668 const int oop_bits = Universe::verify_oop_bits();
669 __ mov(rdx, rax);
670 __ andptr(rdx, oop_mask);
671 __ cmpptr(rdx, oop_bits);
672 __ jcc(Assembler::notZero, error);
673
674 // make sure klass is 'reasonable', which is not zero.
675 __ movptr(rax, Address(rax, oopDesc::klass_offset_in_bytes())); // get klass
676 __ testptr(rax, rax);
677 __ jcc(Assembler::zero, error); // if klass is NULL it is broken
678
679 // return if everything seems ok
680 __ bind(exit);
681 __ movptr(rax, Address(rsp, 5 * wordSize)); // get saved rax, back
682 __ pop(rdx); // restore rdx
683 __ popf(); // restore EFLAGS
684 __ ret(3 * wordSize); // pop arguments
685
686 // handle errors
687 __ bind(error);
688 __ movptr(rax, Address(rsp, 5 * wordSize)); // get saved rax, back
689 __ pop(rdx); // get saved rdx back
690 __ popf(); // get saved EFLAGS off stack -- will be ignored
691 __ pusha(); // push registers (eip = return address & msg are already pushed)
692 BLOCK_COMMENT("call MacroAssembler::debug");
693 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug32)));
694 __ popa();
695 __ ret(3 * wordSize); // pop arguments
696 return start;
697 }
|