< prev index next >

src/share/vm/memory/universe.cpp

Print this page
rev 12858 : 8184323: compile-time guard some UseSharedSpaces-only coding with the INCLUDE_CDS macro

*** 261,275 **** } } void initialize_basic_type_klass(Klass* k, TRAPS) { Klass* ok = SystemDictionary::Object_klass(); if (UseSharedSpaces) { ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data(); assert(k->super() == ok, "u3"); k->restore_unshareable_info(loader_data, Handle(), CHECK); ! } else { k->initialize_supers(ok, CHECK); } k->append_to_sibling_list(); } --- 261,278 ---- } } void initialize_basic_type_klass(Klass* k, TRAPS) { Klass* ok = SystemDictionary::Object_klass(); + #if INCLUDE_CDS if (UseSharedSpaces) { ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data(); assert(k->super() == ok, "u3"); k->restore_unshareable_info(loader_data, Handle(), CHECK); ! } else ! #endif ! { k->initialize_supers(ok, CHECK); } k->append_to_sibling_list(); }
*** 319,336 **** Klass* ok = SystemDictionary::Object_klass(); _the_null_string = StringTable::intern("null", CHECK); _the_min_jint_string = StringTable::intern("-2147483648", CHECK); if (UseSharedSpaces) { // Verify shared interfaces array. assert(_the_array_interfaces_array->at(0) == SystemDictionary::Cloneable_klass(), "u3"); assert(_the_array_interfaces_array->at(1) == SystemDictionary::Serializable_klass(), "u3"); MetaspaceShared::fixup_shared_string_regions(); ! } else { // Set up shared interfaces array. (Do this before supers are set up.) _the_array_interfaces_array->at_put(0, SystemDictionary::Cloneable_klass()); _the_array_interfaces_array->at_put(1, SystemDictionary::Serializable_klass()); } --- 322,342 ---- Klass* ok = SystemDictionary::Object_klass(); _the_null_string = StringTable::intern("null", CHECK); _the_min_jint_string = StringTable::intern("-2147483648", CHECK); + #if INCLUDE_CDS if (UseSharedSpaces) { // Verify shared interfaces array. assert(_the_array_interfaces_array->at(0) == SystemDictionary::Cloneable_klass(), "u3"); assert(_the_array_interfaces_array->at(1) == SystemDictionary::Serializable_klass(), "u3"); MetaspaceShared::fixup_shared_string_regions(); ! } else ! #endif ! { // Set up shared interfaces array. (Do this before supers are set up.) _the_array_interfaces_array->at_put(0, SystemDictionary::Cloneable_klass()); _the_array_interfaces_array->at_put(1, SystemDictionary::Serializable_klass()); }
*** 689,707 **** Universe::_loader_addClass_cache = new LatestMethodCache(); Universe::_pd_implies_cache = new LatestMethodCache(); Universe::_throw_illegal_access_error_cache = new LatestMethodCache(); Universe::_do_stack_walk_cache = new LatestMethodCache(); if (UseSharedSpaces) { // Read the data structures supporting the shared spaces (shared // system dictionary, symbol table, etc.). After that, access to // the file (other than the mapped regions) is no longer needed, and // the file is closed. Closing the file does not affect the // currently mapped regions. MetaspaceShared::initialize_shared_spaces(); StringTable::create_table(); ! } else { SymbolTable::create_table(); StringTable::create_table(); if (DumpSharedSpaces) { MetaspaceShared::prepare_for_dumping(); --- 695,716 ---- Universe::_loader_addClass_cache = new LatestMethodCache(); Universe::_pd_implies_cache = new LatestMethodCache(); Universe::_throw_illegal_access_error_cache = new LatestMethodCache(); Universe::_do_stack_walk_cache = new LatestMethodCache(); + #if INCLUDE_CDS if (UseSharedSpaces) { // Read the data structures supporting the shared spaces (shared // system dictionary, symbol table, etc.). After that, access to // the file (other than the mapped regions) is no longer needed, and // the file is closed. Closing the file does not affect the // currently mapped regions. MetaspaceShared::initialize_shared_spaces(); StringTable::create_table(); ! } else ! #endif ! { SymbolTable::create_table(); StringTable::create_table(); if (DumpSharedSpaces) { MetaspaceShared::prepare_for_dumping();
< prev index next >