8202171: Some oopDesc functions compare this with NULL

Add Method* parameter and made verify* methods static to avoid 'this' comparison with NULL, Added NULL checks before calling print_on() methods.

Reviewed-by: kbarrett, coleenp
This commit is contained in:
Harold Seigel 2018-07-31 14:24:10 -04:00
parent b71f3e7104
commit 38db1d1620
15 changed files with 73 additions and 39 deletions

View file

@ -188,12 +188,20 @@ void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
case T_ARRAY:
st->print(" ");
NOT_LP64(as_int = obj->int_field(offset()));
obj->obj_field(offset())->print_value_on(st);
if (obj->obj_field(offset()) != NULL) {
obj->obj_field(offset())->print_value_on(st);
} else {
st->print_cr("NULL");
}
break;
case T_OBJECT:
st->print(" ");
NOT_LP64(as_int = obj->int_field(offset()));
obj->obj_field(offset())->print_value_on(st);
if (obj->obj_field(offset()) != NULL) {
obj->obj_field(offset())->print_value_on(st);
} else {
st->print_cr("NULL");
}
break;
default:
ShouldNotReachHere();