8263721: Unify oop casting

Reviewed-by: kbarrett, coleenp
This commit is contained in:
Stefan Karlsson 2021-03-24 10:28:38 +00:00
parent 329697b02e
commit a79f095697
90 changed files with 248 additions and 249 deletions

View file

@ -100,7 +100,7 @@ oop Reflection::box(jvalue* value, BasicType type, TRAPS) {
}
if (is_reference_type(type)) {
// regular objects are not boxed
return (oop) value->l;
return cast_to_oop(value->l);
}
oop result = java_lang_boxing_object::create(type, value, CHECK_NULL);
if (result == NULL) {
@ -274,7 +274,7 @@ void Reflection::array_set(jvalue* value, arrayOop a, int index, BasicType value
}
if (a->is_objArray()) {
if (value_type == T_OBJECT) {
oop obj = (oop) value->l;
oop obj = cast_to_oop(value->l);
if (obj != NULL) {
Klass* element_klass = ObjArrayKlass::cast(a->klass())->element_klass();
if (!obj->is_a(element_klass)) {