Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/classLoader.cpp @ 20608:4cb90023bf2b
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
author | iklam |
---|---|
date | Mon, 13 Oct 2014 16:09:57 -0700 |
parents | f0bedf980c65 |
children | 3375833a603e |
comparison
equal
deleted
inserted
replaced
20607:f5f752e74840 | 20608:4cb90023bf2b |
---|---|
608 delete checker; | 608 delete checker; |
609 return result; | 609 return result; |
610 } | 610 } |
611 #endif | 611 #endif |
612 | 612 |
613 void ClassLoader::setup_search_path(const char *class_path) { | 613 void ClassLoader::setup_search_path(const char *class_path, bool canonicalize) { |
614 int offset = 0; | 614 int offset = 0; |
615 int len = (int)strlen(class_path); | 615 int len = (int)strlen(class_path); |
616 int end = 0; | 616 int end = 0; |
617 | 617 |
618 // Iterate over class path entries | 618 // Iterate over class path entries |
623 EXCEPTION_MARK; | 623 EXCEPTION_MARK; |
624 ResourceMark rm(THREAD); | 624 ResourceMark rm(THREAD); |
625 char* path = NEW_RESOURCE_ARRAY(char, end - start + 1); | 625 char* path = NEW_RESOURCE_ARRAY(char, end - start + 1); |
626 strncpy(path, &class_path[start], end - start); | 626 strncpy(path, &class_path[start], end - start); |
627 path[end - start] = '\0'; | 627 path[end - start] = '\0'; |
628 update_class_path_entry_list(path, false); | 628 if (canonicalize) { |
629 char* canonical_path = NEW_RESOURCE_ARRAY(char, JVM_MAXPATHLEN + 1); | |
630 if (get_canonical_path(path, canonical_path, JVM_MAXPATHLEN)) { | |
631 path = canonical_path; | |
632 } | |
633 } | |
634 update_class_path_entry_list(path, /*check_for_duplicates=*/canonicalize); | |
629 #if INCLUDE_CDS | 635 #if INCLUDE_CDS |
630 if (DumpSharedSpaces) { | 636 if (DumpSharedSpaces) { |
631 check_shared_classpath(path); | 637 check_shared_classpath(path); |
632 } | 638 } |
633 #endif | 639 #endif |