comparison src/share/vm/memory/metaspaceShared.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 8cb56c8cb30d
children 3375833a603e
comparison
equal deleted inserted replaced
20607:f5f752e74840 20608:4cb90023bf2b
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "classfile/dictionary.hpp" 26 #include "classfile/dictionary.hpp"
27 #include "classfile/classLoaderExt.hpp"
27 #include "classfile/loaderConstraints.hpp" 28 #include "classfile/loaderConstraints.hpp"
28 #include "classfile/placeholders.hpp" 29 #include "classfile/placeholders.hpp"
29 #include "classfile/sharedClassUtil.hpp" 30 #include "classfile/sharedClassUtil.hpp"
30 #include "classfile/symbolTable.hpp" 31 #include "classfile/symbolTable.hpp"
31 #include "classfile/systemDictionary.hpp" 32 #include "classfile/systemDictionary.hpp"
37 #include "oops/objArrayOop.hpp" 38 #include "oops/objArrayOop.hpp"
38 #include "oops/oop.inline.hpp" 39 #include "oops/oop.inline.hpp"
39 #include "runtime/signature.hpp" 40 #include "runtime/signature.hpp"
40 #include "runtime/vm_operations.hpp" 41 #include "runtime/vm_operations.hpp"
41 #include "runtime/vmThread.hpp" 42 #include "runtime/vmThread.hpp"
43 #include "utilities/hashtable.hpp"
42 #include "utilities/hashtable.inline.hpp" 44 #include "utilities/hashtable.inline.hpp"
43 45
44 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 46 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
45 47
46 int MetaspaceShared::_max_alignment = 0; 48 int MetaspaceShared::_max_alignment = 0;
531 SystemDictionary::copy_table(&md_top, md_end); 533 SystemDictionary::copy_table(&md_top, md_end);
532 ClassLoader::verify(); 534 ClassLoader::verify();
533 ClassLoader::copy_package_info_table(&md_top, md_end); 535 ClassLoader::copy_package_info_table(&md_top, md_end);
534 ClassLoader::verify(); 536 ClassLoader::verify();
535 537
538 ClassLoaderExt::copy_lookup_cache_to_archive(&md_top, md_end);
539
536 // Write the other data to the output array. 540 // Write the other data to the output array.
537 WriteClosure wc(md_top, md_end); 541 WriteClosure wc(md_top, md_end);
538 MetaspaceShared::serialize(&wc); 542 MetaspaceShared::serialize(&wc);
539 md_top = wc.get_top(); 543 md_top = wc.get_top();
540 544
742 if (ExtraSharedClassListFile) { 746 if (ExtraSharedClassListFile) {
743 class_count += preload_and_dump(ExtraSharedClassListFile, class_promote_order, 747 class_count += preload_and_dump(ExtraSharedClassListFile, class_promote_order,
744 THREAD); 748 THREAD);
745 } 749 }
746 tty->print_cr("Loading classes to share: done."); 750 tty->print_cr("Loading classes to share: done.");
751
752 ClassLoaderExt::init_lookup_cache(THREAD);
747 753
748 if (PrintSharedSpaces) { 754 if (PrintSharedSpaces) {
749 tty->print_cr("Shared spaces: preloaded %d classes", class_count); 755 tty->print_cr("Shared spaces: preloaded %d classes", class_count);
750 } 756 }
751 757
1054 1060
1055 len = *(intptr_t*)buffer; // skip over package info table char[] arrays. 1061 len = *(intptr_t*)buffer; // skip over package info table char[] arrays.
1056 buffer += sizeof(intptr_t); 1062 buffer += sizeof(intptr_t);
1057 buffer += len; 1063 buffer += len;
1058 1064
1065 buffer = ClassLoaderExt::restore_lookup_cache_from_archive(buffer);
1066
1059 intptr_t* array = (intptr_t*)buffer; 1067 intptr_t* array = (intptr_t*)buffer;
1060 ReadClosure rc(&array); 1068 ReadClosure rc(&array);
1061 serialize(&rc); 1069 serialize(&rc);
1062 1070
1063 // Close the mapinfo file 1071 // Close the mapinfo file