8147026: Convert an assert in ClassLoaderData to a guarantee
authorshshahma
Tue, 26 Apr 2016 23:29:51 +0530
changeset 38146 1fa5504cd68d
parent 38145 164415057be1
child 38148 858b9417656d
child 38149 f0f1c01a930c
8147026: Convert an assert in ClassLoaderData to a guarantee Summary: Guarantee is to ensure classloader is a valid oop will help catch the errors at an early stage rather than crashing the JVM later on in the GC Reviewed-by: coleenp
hotspot/src/share/vm/classfile/classLoaderData.inline.hpp
--- a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp	Fri Apr 29 14:17:34 2016 +0300
+++ b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp	Tue Apr 26 23:29:51 2016 +0530
@@ -45,7 +45,7 @@
 
 
 inline ClassLoaderData *ClassLoaderDataGraph::find_or_create(Handle loader, TRAPS) {
-  assert(loader() != NULL,"Must be a class loader");
+  guarantee(loader() != NULL && loader()->is_oop(), "Loader must be oop");
   // Gets the class loader data out of the java/lang/ClassLoader object, if non-null
   // it's already in the loader_data, so no need to add
   ClassLoaderData* loader_data= java_lang_ClassLoader::loader_data(loader());