annotate src/share/vm/classfile/classLoaderData.inline.hpp @ 13654:503ddcb96bb0

Merge
author dholmes
date Wed, 27 Sep 2017 01:20:56 -0400
parents 46bb2774fc88
children
rev   line source
coleenp@3602 1 /*
coleenp@13404 2 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
coleenp@3602 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
coleenp@3602 4 *
coleenp@3602 5 * This code is free software; you can redistribute it and/or modify it
coleenp@3602 6 * under the terms of the GNU General Public License version 2 only, as
coleenp@3602 7 * published by the Free Software Foundation.
coleenp@3602 8 *
coleenp@3602 9 * This code is distributed in the hope that it will be useful, but WITHOUT
coleenp@3602 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
coleenp@3602 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
coleenp@3602 12 * version 2 for more details (a copy is included in the LICENSE file that
coleenp@3602 13 * accompanied this code).
coleenp@3602 14 *
coleenp@3602 15 * You should have received a copy of the GNU General Public License version
coleenp@3602 16 * 2 along with this work; if not, write to the Free Software Foundation,
coleenp@3602 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
coleenp@3602 18 *
coleenp@3602 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
coleenp@3602 20 * or visit www.oracle.com if you need additional information or have any
coleenp@3602 21 * questions.
coleenp@3602 22 *
coleenp@3602 23 */
coleenp@3602 24
coleenp@3602 25 #include "classfile/classLoaderData.hpp"
coleenp@3602 26 #include "classfile/javaClasses.hpp"
goetz@9953 27 #include "oops/oop.inline.hpp"
goetz@9953 28
stefank@4232 29 inline ClassLoaderData* ClassLoaderData::class_loader_data_or_null(oop loader) {
stefank@4232 30 if (loader == NULL) {
stefank@4232 31 return ClassLoaderData::the_null_class_loader_data();
stefank@4232 32 }
stefank@4232 33 return java_lang_ClassLoader::loader_data(loader);
stefank@4232 34 }
stefank@4232 35
coleenp@3602 36 inline ClassLoaderData* ClassLoaderData::class_loader_data(oop loader) {
stefank@4232 37 ClassLoaderData* loader_data = class_loader_data_or_null(loader);
coleenp@3602 38 assert(loader_data != NULL, "Must be");
coleenp@3602 39 return loader_data;
coleenp@3602 40 }
coleenp@3602 41
coleenp@3602 42
coleenp@3869 43 inline ClassLoaderData *ClassLoaderDataGraph::find_or_create(Handle loader, TRAPS) {
coleenp@13568 44 guarantee(loader() != NULL && oopDesc::is_oop(loader()), "Loader must be oop");
coleenp@3602 45 // Gets the class loader data out of the java/lang/ClassLoader object, if non-null
coleenp@3602 46 // it's already in the loader_data, so no need to add
mgerdin@4578 47 ClassLoaderData* loader_data= java_lang_ClassLoader::loader_data(loader());
mgerdin@4578 48 if (loader_data) {
mgerdin@4578 49 return loader_data;
coleenp@3602 50 }
mgerdin@4578 51 return ClassLoaderDataGraph::add(loader, false, THREAD);
coleenp@3602 52 }