8210879: ClassLoaderStatsClosure does raw oop comparison
authorzgu
Wed, 19 Sep 2018 16:51:22 -0400
changeset 51809 61f62fb4d4bf
parent 51808 3f32076a43a6
child 51810 414bd559dba8
8210879: ClassLoaderStatsClosure does raw oop comparison Summary: Uses oopDesc::equals() for comparing oop equality Reviewed-by: shade
src/hotspot/share/classfile/classLoaderStats.hpp
--- a/src/hotspot/share/classfile/classLoaderStats.hpp	Wed Sep 19 22:42:34 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderStats.hpp	Wed Sep 19 16:51:22 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 
 #include "classfile/classLoaderData.hpp"
 #include "oops/klass.hpp"
+#include "oops/oop.hpp"
 #include "oops/oopsHierarchy.hpp"
 #include "runtime/vm_operations.hpp"
 #include "services/diagnosticCommand.hpp"
@@ -97,7 +98,7 @@
 class ClassLoaderStatsClosure : public CLDClosure {
 protected:
   static bool oop_equals(oop const& s1, oop const& s2) {
-    return s1 == s2;
+    return oopDesc::equals(s1, s2);
   }
 
   static unsigned oop_hash(oop const& s1) {