classLoader.hpp revision 0
553N/A * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 553N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A// The VM class loader. 0N/A// Meta-index (optional, to be able to skip opening boot classpath jar files) // Class path entry (directory or zip file) // Next entry in class path // may have unlocked readers, so write atomically. virtual const char*
name() = 0;
// Attempt to locate file_name through this class path entry. // Returns a class file parsing stream if successfull. char*
_dir;
// Name of directory // Type definitions for zip file and zip file entry char *
name;
/* entry name */ jlong csize;
/* size of compressed data (zero if uncompressed) */ jint crc;
/* crc of uncompressed data */ char *
comment;
/* optional zip file comment */ jlong pos;
/* position of LOC header (if negative) or data */ // For lazier loading of boot class path entries char*
_path;
// dir or file // First entry in linked list of ClassPathEntry instances // Last entry in linked list of ClassPathEntry instances // Hash table used to keep track of loaded packages static unsigned int hash(
const char *s,
int n);
// Returns the package file name corresponding to the specified package // or class name, or null if not found. // Adds a new package entry for the specified class or package name and // corresponding directory or jar file name. // Canonicalizes path names, so strcmp will work properly. This is mainly // to avoid confusing the zip library // Used by the kernel jvm. // Record how often system loader lock object is contended // Record how often non system loader lock object is contended // Record how many calls to JVM_FindLoadedClass w/o holding a lock // Record how many calls to JVM_DefineClass w/o holding a lock // Record how many calls to jni_DefineClass w/o holding a lock // Record how many calls to Unsafe_DefineClass // Record how many times SystemDictionary::load_instance_class call // fails with linkageError when Unsyncloadclass flag is set. // Load individual .class file // If the specified package has been loaded by the system, then returns // the name of the directory or ZIP file that the package was loaded from. // Returns null if the package was not loaded. // Note: The specified name can either be the name of a class or package. // If a package name is specified, then it must be "/"-separator and also // end with a trailing "/". // Returns an array of Java strings representing all of the currently // loaded system packages. // Note: The package names returned are "/"-separated and end with a assert(e !=
NULL,
"Not that many classpath entries.");
// Sharing dump and restore // VM monitoring and management support // indicates if class path already contains a entry (exact match by name) // adds a class path list // creates a class path zip entry (returns NULL if JAR file cannot be opened) // Force compilation of all methods in all classes in bootstrap class path (stress test)