changeset 58248:d8dbc734645b

8240324: Improve is_boot_class_loader_data() by adding simple check Summary: Check if cld is the null_cld before looking at the class loader oop Reviewed-by: coleenp
author hseigel
date Tue, 03 Mar 2020 15:50:20 +0000
parents 32e20dcd43eb
children e0e5cbb61e86
files src/hotspot/share/classfile/classLoaderData.inline.hpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classLoaderData.inline.hpp	Tue Mar 03 12:41:12 2020 +0100
+++ b/src/hotspot/share/classfile/classLoaderData.inline.hpp	Tue Mar 03 15:50:20 2020 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2020, 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
@@ -39,8 +39,8 @@
 }
 
 inline bool ClassLoaderData::is_boot_class_loader_data() const {
-    return class_loader() == NULL;
-  }
+  return this == _the_null_class_loader_data || class_loader() == NULL;
+}
 
 inline ClassLoaderData* ClassLoaderData::class_loader_data_or_null(oop loader) {
   if (loader == NULL) {