changeset 51197:3a6be93c9660

8204970: Remaing object comparisons need to use oopDesc::equals() Reviewed-by: eosterlund, zgu
author rkennke
date Wed, 25 Jul 2018 21:47:40 +0200
parents 6d9f7c323266
children 979e4708da65
files src/hotspot/share/ci/ciObjectFactory.hpp src/hotspot/share/classfile/modules.cpp
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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");
   }