8199781: Don't use naked == for comparing oops

Reviewed-by: coleenp, eosterlund, jrose
This commit is contained in:
Roman Kennke 2018-04-03 13:15:27 +02:00
parent 8b50176bdc
commit b938ae51ce
36 changed files with 1484 additions and 1282 deletions

View file

@ -2401,7 +2401,7 @@ bool InstanceKlass::is_same_class_package(const Klass* class2) const {
// and package entries. Both must be the same. This rule
// applies even to classes that are defined in the unnamed
// package, they still must have the same class loader.
if ((classloader1 == classloader2) && (classpkg1 == classpkg2)) {
if (oopDesc::equals(classloader1, classloader2) && (classpkg1 == classpkg2)) {
return true;
}
@ -2412,7 +2412,7 @@ bool InstanceKlass::is_same_class_package(const Klass* class2) const {
// and classname information is enough to determine a class's package
bool InstanceKlass::is_same_class_package(oop other_class_loader,
const Symbol* other_class_name) const {
if (class_loader() != other_class_loader) {
if (!oopDesc::equals(class_loader(), other_class_loader)) {
return false;
}
if (name()->fast_compare(other_class_name) == 0) {