8204970: Remaing object comparisons need to use oopDesc::equals()
authorrkennke
Wed, 25 Jul 2018 21:47:40 +0200
changeset 51197 3a6be93c9660
parent 51196 6d9f7c323266
child 51198 979e4708da65
8204970: Remaing object comparisons need to use oopDesc::equals() Reviewed-by: eosterlund, zgu
src/hotspot/share/ci/ciObjectFactory.hpp
src/hotspot/share/classfile/modules.cpp
--- a/src/hotspot/share/ci/ciObjectFactory.hpp	Wed Jul 25 15:38:37 2018 -0400
+++ b/src/hotspot/share/ci/ciObjectFactory.hpp	Wed Jul 25 21:47:40 2018 +0200
@@ -74,7 +74,7 @@
   ciMetadata* create_new_metadata(Metadata* o);
 
   static bool is_equal(NonPermObject* p, oop key) {
-    return p->object()->get_oop() == key;
+    return oopDesc::equals(p->object()->get_oop(), key);
   }
 
   NonPermObject* &find_non_perm(oop key);
--- a/src/hotspot/share/classfile/modules.cpp	Wed Jul 25 15:38:37 2018 -0400
+++ b/src/hotspot/share/classfile/modules.cpp	Wed Jul 25 21:47:40 2018 +0200
@@ -307,7 +307,7 @@
 
   oop loader = java_lang_Module::loader(module_handle());
   // Make sure loader is not the jdk.internal.reflect.DelegatingClassLoader.
-  if (loader != java_lang_ClassLoader::non_reflection_class_loader(loader)) {
+  if (!oopDesc::equals(loader, java_lang_ClassLoader::non_reflection_class_loader(loader))) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Class loader is an invalid delegating class loader");
   }