提交 c3544ce3 编写于 作者: P poonam

8140584: nmethod::oops_do_marking_epilogue always runs verification code

Reviewed-by: stefank
上级 ed613285
...@@ -62,7 +62,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -62,7 +62,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
nativeMovConstReg_at(addr())->set_narrow_oop(no, code()); nativeMovConstReg_at(addr())->set_narrow_oop(no, code());
} }
} else { } else {
assert((address) (nativeMovConstReg_at(addr())->data()) == x, "data must match"); guarantee((address) (nativeMovConstReg_at(addr())->data()) == x, "data must match");
} }
} }
......
...@@ -64,7 +64,7 @@ void NativeInstruction::verify_data64_sethi(address instaddr, intptr_t x) { ...@@ -64,7 +64,7 @@ void NativeInstruction::verify_data64_sethi(address instaddr, intptr_t x) {
masm.patchable_sethi(x, destreg); masm.patchable_sethi(x, destreg);
int len = buffer - masm.pc(); int len = buffer - masm.pc();
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
assert(instaddr[i] == buffer[i], "instructions must match"); guarantee(instaddr[i] == buffer[i], "instructions must match");
} }
} }
......
...@@ -83,7 +83,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -83,7 +83,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
inst &= ~Assembler::simm( -1, 13); inst &= ~Assembler::simm( -1, 13);
inst |= Assembler::simm(simm13, 13); inst |= Assembler::simm(simm13, 13);
if (verify_only) { if (verify_only) {
assert(ip->long_at(0) == inst, "instructions must match"); guarantee(ip->long_at(0) == inst, "instructions must match");
} else { } else {
ip->set_long_at(0, inst); ip->set_long_at(0, inst);
} }
...@@ -101,15 +101,15 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -101,15 +101,15 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
inst &= ~Assembler::hi22(-1); inst &= ~Assembler::hi22(-1);
inst |= Assembler::hi22((intptr_t)np); inst |= Assembler::hi22((intptr_t)np);
if (verify_only) { if (verify_only) {
assert(ip->long_at(0) == inst, "instructions must match"); guarantee(ip->long_at(0) == inst, "instructions must match");
} else { } else {
ip->set_long_at(0, inst); ip->set_long_at(0, inst);
} }
inst2 = ip->long_at( NativeInstruction::nop_instruction_size ); inst2 = ip->long_at( NativeInstruction::nop_instruction_size );
guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op"); guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
if (verify_only) { if (verify_only) {
assert(ip->long_at(NativeInstruction::nop_instruction_size) == NativeInstruction::set_data32_simm13( inst2, (intptr_t)np), guarantee(ip->long_at(NativeInstruction::nop_instruction_size) == NativeInstruction::set_data32_simm13( inst2, (intptr_t)np),
"instructions must match"); "instructions must match");
} else { } else {
ip->set_long_at(NativeInstruction::nop_instruction_size, NativeInstruction::set_data32_simm13( inst2, (intptr_t)np)); ip->set_long_at(NativeInstruction::nop_instruction_size, NativeInstruction::set_data32_simm13( inst2, (intptr_t)np));
} }
...@@ -126,7 +126,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -126,7 +126,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
inst |= Assembler::hi22((intptr_t)x); inst |= Assembler::hi22((intptr_t)x);
// (ignore offset; it doesn't play into the sethi) // (ignore offset; it doesn't play into the sethi)
if (verify_only) { if (verify_only) {
assert(ip->long_at(0) == inst, "instructions must match"); guarantee(ip->long_at(0) == inst, "instructions must match");
} else { } else {
ip->set_long_at(0, inst); ip->set_long_at(0, inst);
} }
......
...@@ -40,7 +40,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -40,7 +40,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
which == Assembler::imm_operand, "format unpacks ok"); which == Assembler::imm_operand, "format unpacks ok");
if (which == Assembler::imm_operand) { if (which == Assembler::imm_operand) {
if (verify_only) { if (verify_only) {
assert(*pd_address_in_code() == x, "instructions must match"); guarantee(*pd_address_in_code() == x, "instructions must match");
} else { } else {
*pd_address_in_code() = x; *pd_address_in_code() = x;
} }
...@@ -49,13 +49,13 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -49,13 +49,13 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
// both compressed oops and compressed classes look the same // both compressed oops and compressed classes look the same
if (Universe::heap()->is_in_reserved((oop)x)) { if (Universe::heap()->is_in_reserved((oop)x)) {
if (verify_only) { if (verify_only) {
assert(*(uint32_t*) disp == oopDesc::encode_heap_oop((oop)x), "instructions must match"); guarantee(*(uint32_t*) disp == oopDesc::encode_heap_oop((oop)x), "instructions must match");
} else { } else {
*(int32_t*) disp = oopDesc::encode_heap_oop((oop)x); *(int32_t*) disp = oopDesc::encode_heap_oop((oop)x);
} }
} else { } else {
if (verify_only) { if (verify_only) {
assert(*(uint32_t*) disp == Klass::encode_klass((Klass*)x), "instructions must match"); guarantee(*(uint32_t*) disp == Klass::encode_klass((Klass*)x), "instructions must match");
} else { } else {
*(int32_t*) disp = Klass::encode_klass((Klass*)x); *(int32_t*) disp = Klass::encode_klass((Klass*)x);
} }
...@@ -66,14 +66,14 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -66,14 +66,14 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
address disp = Assembler::locate_operand(ip, which); address disp = Assembler::locate_operand(ip, which);
address next_ip = Assembler::locate_next_instruction(ip); address next_ip = Assembler::locate_next_instruction(ip);
if (verify_only) { if (verify_only) {
assert(*(int32_t*) disp == (x - next_ip), "instructions must match"); guarantee(*(int32_t*) disp == (x - next_ip), "instructions must match");
} else { } else {
*(int32_t*) disp = x - next_ip; *(int32_t*) disp = x - next_ip;
} }
} }
#else #else
if (verify_only) { if (verify_only) {
assert(*pd_address_in_code() == (x + o), "instructions must match"); guarantee(*pd_address_in_code() == (x + o), "instructions must match");
} else { } else {
*pd_address_in_code() = x + o; *pd_address_in_code() = x + o;
} }
......
...@@ -2290,7 +2290,7 @@ void nmethod::oops_do_marking_epilogue() { ...@@ -2290,7 +2290,7 @@ void nmethod::oops_do_marking_epilogue() {
assert(cur != NULL, "not NULL-terminated"); assert(cur != NULL, "not NULL-terminated");
nmethod* next = cur->_oops_do_mark_link; nmethod* next = cur->_oops_do_mark_link;
cur->_oops_do_mark_link = NULL; cur->_oops_do_mark_link = NULL;
cur->verify_oop_relocations(); DEBUG_ONLY(cur->verify_oop_relocations());
NOT_PRODUCT(if (TraceScavenge) cur->print_on(tty, "oops_do, unmark")); NOT_PRODUCT(if (TraceScavenge) cur->print_on(tty, "oops_do, unmark"));
cur = next; cur = next;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册