src/hotspot/share/classfile/classLoader.hpp
changeset 52934 8deeb7bba516
parent 52076 f8626bcc1698
child 52960 a6182c464b31
equal deleted inserted replaced
52933:13173122094f 52934:8deeb7bba516
    58   // Constructor
    58   // Constructor
    59   ClassPathEntry() : _next(NULL) {}
    59   ClassPathEntry() : _next(NULL) {}
    60   // Attempt to locate file_name through this class path entry.
    60   // Attempt to locate file_name through this class path entry.
    61   // Returns a class file parsing stream if successfull.
    61   // Returns a class file parsing stream if successfull.
    62   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
    62   virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
    63   // Debugging
       
    64   NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
       
    65 };
    63 };
    66 
    64 
    67 class ClassPathDirEntry: public ClassPathEntry {
    65 class ClassPathDirEntry: public ClassPathEntry {
    68  private:
    66  private:
    69   const char* _dir;           // Name of directory
    67   const char* _dir;           // Name of directory
    73   const char* name() const { return _dir; }
    71   const char* name() const { return _dir; }
    74   JImageFile* jimage() const { return NULL; }
    72   JImageFile* jimage() const { return NULL; }
    75   ClassPathDirEntry(const char* dir);
    73   ClassPathDirEntry(const char* dir);
    76   virtual ~ClassPathDirEntry() {}
    74   virtual ~ClassPathDirEntry() {}
    77   ClassFileStream* open_stream(const char* name, TRAPS);
    75   ClassFileStream* open_stream(const char* name, TRAPS);
    78   // Debugging
       
    79   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
       
    80 };
    76 };
    81 
    77 
    82 
    78 
    83 // Type definitions for zip file and zip file entry
    79 // Type definitions for zip file and zip file entry
    84 typedef void* jzfile;
    80 typedef void* jzfile;
   105   ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append);
   101   ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append);
   106   virtual ~ClassPathZipEntry();
   102   virtual ~ClassPathZipEntry();
   107   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
   103   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
   108   ClassFileStream* open_stream(const char* name, TRAPS);
   104   ClassFileStream* open_stream(const char* name, TRAPS);
   109   void contents_do(void f(const char* name, void* context), void* context);
   105   void contents_do(void f(const char* name, void* context), void* context);
   110   // Debugging
       
   111   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
       
   112 };
   106 };
   113 
   107 
   114 
   108 
   115 // For java image files
   109 // For java image files
   116 class ClassPathImageEntry: public ClassPathEntry {
   110 class ClassPathImageEntry: public ClassPathEntry {
   124   const char* name() const { return _name == NULL ? "" : _name; }
   118   const char* name() const { return _name == NULL ? "" : _name; }
   125   JImageFile* jimage() const { return _jimage; }
   119   JImageFile* jimage() const { return _jimage; }
   126   ClassPathImageEntry(JImageFile* jimage, const char* name);
   120   ClassPathImageEntry(JImageFile* jimage, const char* name);
   127   virtual ~ClassPathImageEntry();
   121   virtual ~ClassPathImageEntry();
   128   ClassFileStream* open_stream(const char* name, TRAPS);
   122   ClassFileStream* open_stream(const char* name, TRAPS);
   129 
       
   130   // Debugging
       
   131   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
       
   132 };
   123 };
   133 
   124 
   134 // ModuleClassPathList contains a linked list of ClassPathEntry's
   125 // ModuleClassPathList contains a linked list of ClassPathEntry's
   135 // that have been specified for a specific module.  Currently,
   126 // that have been specified for a specific module.  Currently,
   136 // the only way to specify a module/path pair is via the --patch-module
   127 // the only way to specify a module/path pair is via the --patch-module
   445 
   436 
   446   static bool is_modules_image(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); }
   437   static bool is_modules_image(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); }
   447 
   438 
   448   // Debugging
   439   // Debugging
   449   static void verify()              PRODUCT_RETURN;
   440   static void verify()              PRODUCT_RETURN;
   450 
       
   451   // Force compilation of all methods in all classes in bootstrap class path (stress test)
       
   452 #ifndef PRODUCT
       
   453  protected:
       
   454   static int _compile_the_world_class_counter;
       
   455   static int _compile_the_world_method_counter;
       
   456  public:
       
   457   static void compile_the_world();
       
   458   static void compile_the_world_in(char* name, Handle loader, TRAPS);
       
   459   static int  compile_the_world_counter() { return _compile_the_world_class_counter; }
       
   460 #endif //PRODUCT
       
   461 };
   441 };
   462 
   442 
   463 // PerfClassTraceTime is used to measure time for class loading related events.
   443 // PerfClassTraceTime is used to measure time for class loading related events.
   464 // This class tracks cumulative time and exclusive time for specific event types.
   444 // This class tracks cumulative time and exclusive time for specific event types.
   465 // During the execution of one event, other event types (e.g. class loading and
   445 // During the execution of one event, other event types (e.g. class loading and