1097 enum {
1098 // After previous pushes.
1099 oop_to_verify = 6 * wordSize,
1100 saved_rax = 7 * wordSize,
1101 saved_r10 = 8 * wordSize,
1102
1103 // Before the call to MacroAssembler::debug(), see below.
1104 return_addr = 16 * wordSize,
1105 error_msg = 17 * wordSize
1106 };
1107
1108 // get object
1109 __ movptr(rax, Address(rsp, oop_to_verify));
1110
1111 // make sure object is 'reasonable'
1112 __ testptr(rax, rax);
1113 __ jcc(Assembler::zero, exit); // if obj is NULL it is OK
1114
1115 if (UseLoadBarrier) {
1116 // Check if metadata bits indicate a bad oop
1117 __ testptr(rax, ExternalAddress((address)&ZAddressBadMask));
1118 __ jcc(Assembler::notZero, error);
1119 }
1120
1121 // Check if the oop is in the right area of memory
1122 __ movptr(c_rarg2, rax);
1123 __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_mask());
1124 __ andptr(c_rarg2, c_rarg3);
1125 __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_bits());
1126 __ cmpptr(c_rarg2, c_rarg3);
1127 __ jcc(Assembler::notZero, error);
1128
1129 // set r12 to heapbase for load_klass()
1130 __ reinit_heapbase();
1131
1132 // make sure klass is 'reasonable', which is not zero.
1133 __ load_klass(rax, rax); // get klass
1134 __ testptr(rax, rax);
1135 __ jcc(Assembler::zero, error); // if klass is NULL it is broken
1136
1137 // return if everything seems ok
|
1097 enum {
1098 // After previous pushes.
1099 oop_to_verify = 6 * wordSize,
1100 saved_rax = 7 * wordSize,
1101 saved_r10 = 8 * wordSize,
1102
1103 // Before the call to MacroAssembler::debug(), see below.
1104 return_addr = 16 * wordSize,
1105 error_msg = 17 * wordSize
1106 };
1107
1108 // get object
1109 __ movptr(rax, Address(rsp, oop_to_verify));
1110
1111 // make sure object is 'reasonable'
1112 __ testptr(rax, rax);
1113 __ jcc(Assembler::zero, exit); // if obj is NULL it is OK
1114
1115 if (UseLoadBarrier) {
1116 // Check if metadata bits indicate a bad oop
1117 __ testptr(rax, Address(r15_thread, JavaThread::zaddress_bad_mask_offset()));
1118 __ jcc(Assembler::notZero, error);
1119 }
1120
1121 // Check if the oop is in the right area of memory
1122 __ movptr(c_rarg2, rax);
1123 __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_mask());
1124 __ andptr(c_rarg2, c_rarg3);
1125 __ movptr(c_rarg3, (intptr_t) Universe::verify_oop_bits());
1126 __ cmpptr(c_rarg2, c_rarg3);
1127 __ jcc(Assembler::notZero, error);
1128
1129 // set r12 to heapbase for load_klass()
1130 __ reinit_heapbase();
1131
1132 // make sure klass is 'reasonable', which is not zero.
1133 __ load_klass(rax, rax); // get klass
1134 __ testptr(rax, rax);
1135 __ jcc(Assembler::zero, error); // if klass is NULL it is broken
1136
1137 // return if everything seems ok
|