src/share/vm/classfile/classLoaderExt.hpp

Thu, 12 Oct 2017 21:27:07 +0800

author
aoqi
date
Thu, 12 Oct 2017 21:27:07 +0800
changeset 7535
7ae4e26cb1e0
parent 7381
887a7cedb892
permissions
-rw-r--r--

merge

iklam@7089 1 /*
iklam@7089 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
iklam@7089 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
iklam@7089 4 *
iklam@7089 5 * This code is free software; you can redistribute it and/or modify it
iklam@7089 6 * under the terms of the GNU General Public License version 2 only, as
iklam@7089 7 * published by the Free Software Foundation.
iklam@7089 8 *
iklam@7089 9 * This code is distributed in the hope that it will be useful, but WITHOUT
iklam@7089 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
iklam@7089 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
iklam@7089 12 * version 2 for more details (a copy is included in the LICENSE file that
iklam@7089 13 * accompanied this code).
iklam@7089 14 *
iklam@7089 15 * You should have received a copy of the GNU General Public License version
iklam@7089 16 * 2 along with this work; if not, write to the Free Software Foundation,
iklam@7089 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
iklam@7089 18 *
iklam@7089 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
iklam@7089 20 * or visit www.oracle.com if you need additional information or have any
iklam@7089 21 * questions.
iklam@7089 22 *
iklam@7089 23 */
iklam@7089 24
iklam@7089 25 #ifndef SHARE_VM_CLASSFILE_CLASSLOADEREXT_HPP
iklam@7089 26 #define SHARE_VM_CLASSFILE_CLASSLOADEREXT_HPP
iklam@7089 27
iklam@7089 28 #include "classfile/classLoader.hpp"
iklam@7089 29
iklam@7089 30 class ClassLoaderExt: public ClassLoader { // AllStatic
iklam@7089 31 public:
iklam@7089 32
iklam@7089 33 class Context {
iklam@7089 34 const char* _file_name;
iklam@7089 35 public:
iklam@7089 36 Context(const char* class_name, const char* file_name, TRAPS) {
iklam@7089 37 _file_name = file_name;
iklam@7089 38 }
iklam@7089 39
iklam@7089 40 bool check(ClassFileStream* stream, const int classpath_index) {
iklam@7089 41 return true;
iklam@7089 42 }
iklam@7089 43
iklam@7089 44 bool should_verify(int classpath_index) {
iklam@7089 45 return false;
iklam@7089 46 }
iklam@7089 47
iklam@7089 48 instanceKlassHandle record_result(const int classpath_index,
iklam@7089 49 ClassPathEntry* e, instanceKlassHandle result, TRAPS) {
iklam@7089 50 if (ClassLoader::add_package(_file_name, classpath_index, THREAD)) {
iklam@7089 51 if (DumpSharedSpaces) {
iklam@7089 52 result->set_shared_classpath_index(classpath_index);
iklam@7089 53 }
iklam@7089 54 return result;
iklam@7089 55 } else {
iklam@7089 56 return instanceKlassHandle(); // NULL
iklam@7089 57 }
iklam@7089 58 }
iklam@7089 59 };
iklam@7089 60
iklam@7089 61
iklam@7090 62 static void add_class_path_entry(const char* path, bool check_for_duplicates,
iklam@7090 63 ClassPathEntry* new_entry) {
iklam@7089 64 ClassLoader::add_to_list(new_entry);
iklam@7089 65 }
iklam@7381 66 static void append_boot_classpath(ClassPathEntry* new_entry) {
iklam@7381 67 ClassLoader::add_to_list(new_entry);
iklam@7381 68 }
iklam@7089 69 static void setup_search_paths() {}
iklam@7322 70
iklam@7322 71 static void init_lookup_cache(TRAPS) {}
iklam@7322 72 static void copy_lookup_cache_to_archive(char** top, char* end) {}
iklam@7322 73 static char* restore_lookup_cache_from_archive(char* buffer) {return buffer;}
iklam@7322 74 static inline bool is_lookup_cache_enabled() {return false;}
iklam@7322 75
iklam@7322 76 static bool known_to_not_exist(JNIEnv *env, jobject loader, const char *classname, TRAPS) {return false;}
iklam@7322 77 static jobjectArray get_lookup_cache_urls(JNIEnv *env, jobject loader, TRAPS) {return NULL;}
iklam@7322 78 static jintArray get_lookup_cache(JNIEnv *env, jobject loader, const char *pkgname, TRAPS) {return NULL;}
iklam@7089 79 };
iklam@7089 80
iklam@7089 81 #endif // SHARE_VM_CLASSFILE_CLASSLOADEREXT_HPP

mercurial