hotspot/src/share/vm/classfile/classLoader.hpp
changeset 27562 47f369e3c69c
parent 27025 f4805f778f16
child 27711 0b952ebd3953
equal deleted inserted replaced
27561:7ead528de130 27562:47f369e3c69c
    64   // Attempt to locate file_name through this class path entry.
    64   // Attempt to locate file_name through this class path entry.
    65   // Returns a class file parsing stream if successfull.
    65   // Returns a class file parsing stream if successfull.
    66   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
    66   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
    67   // Debugging
    67   // Debugging
    68   NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
    68   NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
    69   NOT_PRODUCT(virtual bool is_rt_jar() = 0;)
    69   NOT_PRODUCT(virtual bool is_jrt() = 0;)
    70 };
    70 };
    71 
    71 
    72 
    72 
    73 class ClassPathDirEntry: public ClassPathEntry {
    73 class ClassPathDirEntry: public ClassPathEntry {
    74  private:
    74  private:
    78   const char* name()  { return _dir; }
    78   const char* name()  { return _dir; }
    79   ClassPathDirEntry(const char* dir);
    79   ClassPathDirEntry(const char* dir);
    80   ClassFileStream* open_stream(const char* name, TRAPS);
    80   ClassFileStream* open_stream(const char* name, TRAPS);
    81   // Debugging
    81   // Debugging
    82   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
    82   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
    83   NOT_PRODUCT(bool is_rt_jar();)
    83   NOT_PRODUCT(bool is_jrt();)
    84 };
    84 };
    85 
    85 
    86 
    86 
    87 // Type definitions for zip file and zip file entry
    87 // Type definitions for zip file and zip file entry
    88 typedef void* jzfile;
    88 typedef void* jzfile;
   110   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
   110   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
   111   ClassFileStream* open_stream(const char* name, TRAPS);
   111   ClassFileStream* open_stream(const char* name, TRAPS);
   112   void contents_do(void f(const char* name, void* context), void* context);
   112   void contents_do(void f(const char* name, void* context), void* context);
   113   // Debugging
   113   // Debugging
   114   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
   114   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
   115   NOT_PRODUCT(bool is_rt_jar();)
   115   NOT_PRODUCT(bool is_jrt();)
   116 };
   116 };
   117 
   117 
   118 
   118 
   119 // For lazier loading of boot class path entries
   119 // For lazier loading of boot class path entries
   120 class LazyClassPathEntry: public ClassPathEntry {
   120 class LazyClassPathEntry: public ClassPathEntry {
   136   ClassFileStream* open_stream(const char* name, TRAPS);
   136   ClassFileStream* open_stream(const char* name, TRAPS);
   137   void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
   137   void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
   138   virtual bool is_lazy();
   138   virtual bool is_lazy();
   139   // Debugging
   139   // Debugging
   140   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
   140   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
   141   NOT_PRODUCT(bool is_rt_jar();)
   141   NOT_PRODUCT(bool is_jrt();)
       
   142 };
       
   143 
       
   144 // For java image files
       
   145 class ImageFile;
       
   146 class ClassPathImageEntry: public ClassPathEntry {
       
   147 private:
       
   148   ImageFile *_image;
       
   149 public:
       
   150   bool is_jar_file()  { return false;  }
       
   151   bool is_open()  { return _image != NULL; }
       
   152   const char* name();
       
   153   ClassPathImageEntry(char* name);
       
   154   ~ClassPathImageEntry();
       
   155   ClassFileStream* open_stream(const char* name, TRAPS);
       
   156 
       
   157   // Debugging
       
   158   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
       
   159   NOT_PRODUCT(bool is_jrt();)
   142 };
   160 };
   143 
   161 
   144 class PackageHashtable;
   162 class PackageHashtable;
   145 class PackageInfo;
   163 class PackageInfo;
   146 class SharedPathsMiscInfo;
   164 class SharedPathsMiscInfo;
   224 
   242 
   225   // Canonicalizes path names, so strcmp will work properly. This is mainly
   243   // Canonicalizes path names, so strcmp will work properly. This is mainly
   226   // to avoid confusing the zip library
   244   // to avoid confusing the zip library
   227   static bool get_canonical_path(const char* orig, char* out, int len);
   245   static bool get_canonical_path(const char* orig, char* out, int len);
   228  public:
   246  public:
       
   247   static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg);
   229   static int crc32(int crc, const char* buf, int len);
   248   static int crc32(int crc, const char* buf, int len);
   230   static bool update_class_path_entry_list(const char *path,
   249   static bool update_class_path_entry_list(const char *path,
   231                                            bool check_for_duplicates,
   250                                            bool check_for_duplicates,
   232                                            bool throw_exception=true);
   251                                            bool throw_exception=true);
   233   static void print_bootclasspath();
   252   static void print_bootclasspath();