< prev index next > src/hotspot/share/classfile/classLoader.hpp
Print this page
u1* open_entry(JavaThread* current, const char* name, jint* filesize, bool nul_terminate);
ClassFileStream* open_stream(JavaThread* current, const char* name);
};
- // For java image files
+ // A singleton path entry which takes ownership of the initialized JImageFile
+ // reference. Not used for exploded builds.
class ClassPathImageEntry: public ClassPathEntry {
private:
const char* _name;
DEBUG_ONLY(static ClassPathImageEntry* _singleton;)
public:
bool is_modules_image() const;
const char* name() const { return _name == nullptr ? "" : _name; }
- JImageFile* jimage() const;
- JImageFile* jimage_non_null() const;
+ // Called to close the JImage during os::abort (normally not called).
void close_jimage();
- ClassPathImageEntry(JImageFile* jimage, const char* name);
+ // Takes effective ownership of the static JImageFile pointer.
+ ClassPathImageEntry(const char* name);
virtual ~ClassPathImageEntry() { ShouldNotReachHere(); }
+
ClassFileStream* open_stream(JavaThread* current, const char* name);
ClassFileStream* open_stream_for_loader(JavaThread* current, const char* name, ClassLoaderData* loader_data);
};
// ModuleClassPathList contains a linked list of ClassPathEntry's
// 1. Contains the module/path pairs specified to --patch-module
static GrowableArray<ModuleClassPathList*>* _patch_mod_entries;
// 2. the base piece
- // Contains the ClassPathEntry of the modular java runtime image.
+ // Contains the ClassPathImageEntry of the modular java runtime image.
// If no java runtime image is present, this indicates a
// build with exploded modules is being used instead.
- static ClassPathEntry* _jrt_entry;
+ static ClassPathImageEntry* _jrt_entry;
static GrowableArray<ModuleClassPathList*>* _exploded_entries;
enum { EXPLODED_ENTRY_SIZE = 80 }; // Initial number of exploded modules
// 3. the boot loader's append path
// [-Xbootclasspath/a]; [jvmti appended entries]
static void record_result_for_builtin_loader(s2 classpath_index, InstanceKlass* result, bool redefined);
static void record_hidden_class(InstanceKlass* ik);
static void append_boot_classpath(ClassPathEntry* new_entry);
#endif
+ // Retrieves additional VM options prior to flags processing. Options held
+ // in the JImage file are retrieved without fully initializing it. (this is
+ // the only JImage lookup which can succeed before init_jimage() is called).
static char* lookup_vm_options();
+ // Called once, after all flags are processed, to finish initializing the
+ // JImage file. Until this is called, jimage_find_resource(), and any other
+ // JImage resource lookups or access will fail.
+ static void init_jimage(bool enable_preview);
+
// Determines if the named module is present in the
// modules jimage file or in the exploded modules directory.
static bool is_module_observable(const char* module_name);
- static JImageLocationRef jimage_find_resource(JImageFile* jf, const char* module_name,
- const char* file_name, jlong &size);
-
static void trace_class_path(const char* msg, const char* name = nullptr);
// VM monitoring and management support
static jlong classloader_time_ms();
static jlong class_method_total_size();
< prev index next >