< prev index next >

src/share/vm/classfile/classLoader.hpp

Print this page




  33 // The VM class loader.
  34 #include <sys/stat.h>
  35 
  36 // Name of boot "modules" image
  37 #define  MODULES_IMAGE_NAME "modules"
  38 
  39 // Name of the resource containing mapping from module names to defining class loader type
  40 #define MODULE_LOADER_MAP "jdk/internal/vm/cds/resources/ModuleLoaderMap.dat"
  41 
  42 // Initial sizes of the following arrays are based on the generated ModuleLoaderMap.dat
  43 #define INITIAL_BOOT_MODULES_ARRAY_SIZE 30
  44 #define INITIAL_PLATFORM_MODULES_ARRAY_SIZE  15
  45 
  46 // Class path entry (directory or zip file)
  47 
  48 class JImageFile;
  49 class ClassFileStream;
  50 
  51 class ClassPathEntry : public CHeapObj<mtClass> {
  52 private:
  53   ClassPathEntry* _next;
  54 public:
  55   // Next entry in class path
  56   ClassPathEntry* next() const { return _next; }


  57   void set_next(ClassPathEntry* next) {
  58     // may have unlocked readers, so write atomically.
  59     OrderAccess::release_store_ptr(&_next, next);
  60   }
  61   virtual bool is_jrt() = 0;
  62   virtual bool is_jar_file() const = 0;
  63   virtual const char* name() const = 0;
  64   virtual JImageFile* jimage() const = 0;
  65   // Constructor
  66   ClassPathEntry() : _next(NULL) {}
  67   // Attempt to locate file_name through this class path entry.
  68   // Returns a class file parsing stream if successfull.
  69   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
  70   // Debugging
  71   NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
  72 };
  73 
  74 class ClassPathDirEntry: public ClassPathEntry {
  75  private:
  76   const char* _dir;           // Name of directory
  77  public:
  78   bool is_jrt()            { return false; }




  33 // The VM class loader.
  34 #include <sys/stat.h>
  35 
  36 // Name of boot "modules" image
  37 #define  MODULES_IMAGE_NAME "modules"
  38 
  39 // Name of the resource containing mapping from module names to defining class loader type
  40 #define MODULE_LOADER_MAP "jdk/internal/vm/cds/resources/ModuleLoaderMap.dat"
  41 
  42 // Initial sizes of the following arrays are based on the generated ModuleLoaderMap.dat
  43 #define INITIAL_BOOT_MODULES_ARRAY_SIZE 30
  44 #define INITIAL_PLATFORM_MODULES_ARRAY_SIZE  15
  45 
  46 // Class path entry (directory or zip file)
  47 
  48 class JImageFile;
  49 class ClassFileStream;
  50 
  51 class ClassPathEntry : public CHeapObj<mtClass> {
  52 private:
  53   ClassPathEntry* volatile _next;
  54 public:
  55   // Next entry in class path
  56   ClassPathEntry* next() const {
  57     return (ClassPathEntry*) OrderAccess::load_ptr_acquire(&_next);
  58   }
  59   void set_next(ClassPathEntry* next) {
  60     // may have unlocked readers, so ensure visibility.
  61     OrderAccess::release_store_ptr(&_next, next);
  62   }
  63   virtual bool is_jrt() = 0;
  64   virtual bool is_jar_file() const = 0;
  65   virtual const char* name() const = 0;
  66   virtual JImageFile* jimage() const = 0;
  67   // Constructor
  68   ClassPathEntry() : _next(NULL) {}
  69   // Attempt to locate file_name through this class path entry.
  70   // Returns a class file parsing stream if successfull.
  71   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
  72   // Debugging
  73   NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
  74 };
  75 
  76 class ClassPathDirEntry: public ClassPathEntry {
  77  private:
  78   const char* _dir;           // Name of directory
  79  public:
  80   bool is_jrt()            { return false; }


< prev index next >