Print this page
rev 6864 : 8061651: Interface to the Lookup Index Cache to improve URLClassPath search time
Summary: Implemented the interface in sun.misc.URLClassPath and corresponding JVM_XXX APIs
Reviewed-by: mchung, acorn, jiangli, dholmes

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/classfile/classLoader.hpp
          +++ new/src/share/vm/classfile/classLoader.hpp
↓ open down ↓ 121 lines elided ↑ open up ↑
 122  122  
 123  123  // For lazier loading of boot class path entries
 124  124  class LazyClassPathEntry: public ClassPathEntry {
 125  125   private:
 126  126    const char* _path; // dir or file
 127  127    struct stat _st;
 128  128    MetaIndex* _meta_index;
 129  129    bool _has_error;
 130  130    bool _throw_exception;
 131  131    volatile ClassPathEntry* _resolved_entry;
 132      -  ClassPathEntry* resolve_entry(TRAPS);
 133  132   public:
      133 +  ClassPathEntry* resolve_entry(TRAPS);
 134  134    bool is_jar_file();
 135  135    const char* name()  { return _path; }
 136  136    LazyClassPathEntry(const char* path, const struct stat* st, bool throw_exception);
 137  137    u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
 138  138    ClassFileStream* open_stream(const char* name, TRAPS);
 139  139    void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
 140  140    virtual bool is_lazy();
 141  141    // Debugging
 142  142    NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
 143  143    NOT_PRODUCT(bool is_rt_jar();)
↓ open down ↓ 67 lines elided ↑ open up ↑
 211  211    static PackageInfo* lookup_package(const char *pkgname);
 212  212    // Adds a new package entry for the specified class or package name and
 213  213    // corresponding directory or jar file name.
 214  214    static bool add_package(const char *pkgname, int classpath_index, TRAPS);
 215  215  
 216  216    // Initialization
 217  217    static void setup_bootstrap_meta_index();
 218  218    static void setup_meta_index(const char* meta_index_path, const char* meta_index_dir,
 219  219                                 int start_index);
 220  220    static void setup_bootstrap_search_path();
 221      -  static void setup_search_path(const char *class_path);
      221 +  static void setup_search_path(const char *class_path, bool canonicalize=false);
 222  222  
 223  223    static void load_zip_library();
 224  224    static ClassPathEntry* create_class_path_entry(const char *path, const struct stat* st,
 225  225                                                   bool lazy, bool throw_exception, TRAPS);
 226  226  
 227  227    // Canonicalizes path names, so strcmp will work properly. This is mainly
 228  228    // to avoid confusing the zip library
 229  229    static bool get_canonical_path(const char* orig, char* out, int len);
 230  230   public:
 231  231    static int crc32(int crc, const char* buf, int len);
↓ open down ↓ 90 lines elided ↑ open up ↑
 322  322  
 323  323    static ClassPathEntry* classpath_entry(int n) {
 324  324      ClassPathEntry* e = ClassLoader::_first_entry;
 325  325      while (--n >= 0) {
 326  326        assert(e != NULL, "Not that many classpath entries.");
 327  327        e = e->next();
 328  328      }
 329  329      return e;
 330  330    }
 331  331  
      332 +  static int num_classpath_entries() {
      333 +    return _num_entries;
      334 +  }
      335 +
 332  336  #if INCLUDE_CDS
 333  337    // Sharing dump and restore
 334  338    static void copy_package_info_buckets(char** top, char* end);
 335  339    static void copy_package_info_table(char** top, char* end);
 336  340  
 337  341    static void  check_shared_classpath(const char *path);
 338  342    static void  finalize_shared_paths_misc_info();
 339  343    static int   get_shared_paths_misc_info_size();
 340  344    static void* get_shared_paths_misc_info();
 341  345    static bool  check_shared_paths_misc_info(void* info, int size);
↓ open down ↓ 100 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX