1428 }
1429 }
1430
1431 if (result == MAP_ARCHIVE_SUCCESS) {
1432 SharedBaseAddress = (size_t)mapped_base_address;
1433 LP64_ONLY({
1434 if (Metaspace::using_class_space()) {
1435 // Set up ccs in metaspace.
1436 Metaspace::initialize_class_space(class_space_rs);
1437
1438 // Set up compressed Klass pointer encoding: the encoding range must
1439 // cover both archive and class space.
1440 address cds_base = (address)static_mapinfo->mapped_base();
1441 address ccs_end = (address)class_space_rs.end();
1442 CompressedKlassPointers::initialize(cds_base, ccs_end - cds_base);
1443
1444 // map_heap_regions() compares the current narrow oop and klass encodings
1445 // with the archived ones, so it must be done after all encodings are determined.
1446 static_mapinfo->map_heap_regions();
1447
1448 disable_full_module_graph(); // Disabled temporarily for JDK-8253081
1449 }
1450 });
1451 log_info(cds)("optimized module handling: %s", MetaspaceShared::use_optimized_module_handling() ? "enabled" : "disabled");
1452 log_info(cds)("full module graph: %s", MetaspaceShared::use_full_module_graph() ? "enabled" : "disabled");
1453 } else {
1454 unmap_archive(static_mapinfo);
1455 unmap_archive(dynamic_mapinfo);
1456 release_reserved_spaces(archive_space_rs, class_space_rs);
1457 }
1458
1459 return result;
1460 }
1461
1462
1463 // This will reserve two address spaces suitable to house Klass structures, one
1464 // for the cds archives (static archive and optionally dynamic archive) and
1465 // optionally one move for ccs.
1466 //
1467 // Since both spaces must fall within the compressed class pointer encoding
1468 // range, they are allocated close to each other.
|
1428 }
1429 }
1430
1431 if (result == MAP_ARCHIVE_SUCCESS) {
1432 SharedBaseAddress = (size_t)mapped_base_address;
1433 LP64_ONLY({
1434 if (Metaspace::using_class_space()) {
1435 // Set up ccs in metaspace.
1436 Metaspace::initialize_class_space(class_space_rs);
1437
1438 // Set up compressed Klass pointer encoding: the encoding range must
1439 // cover both archive and class space.
1440 address cds_base = (address)static_mapinfo->mapped_base();
1441 address ccs_end = (address)class_space_rs.end();
1442 CompressedKlassPointers::initialize(cds_base, ccs_end - cds_base);
1443
1444 // map_heap_regions() compares the current narrow oop and klass encodings
1445 // with the archived ones, so it must be done after all encodings are determined.
1446 static_mapinfo->map_heap_regions();
1447
1448 // disable_full_module_graph(); // Disabled temporarily for JDK-8253081
1449 }
1450 });
1451 log_info(cds)("optimized module handling: %s", MetaspaceShared::use_optimized_module_handling() ? "enabled" : "disabled");
1452 log_info(cds)("full module graph: %s", MetaspaceShared::use_full_module_graph() ? "enabled" : "disabled");
1453 } else {
1454 unmap_archive(static_mapinfo);
1455 unmap_archive(dynamic_mapinfo);
1456 release_reserved_spaces(archive_space_rs, class_space_rs);
1457 }
1458
1459 return result;
1460 }
1461
1462
1463 // This will reserve two address spaces suitable to house Klass structures, one
1464 // for the cds archives (static archive and optionally dynamic archive) and
1465 // optionally one move for ccs.
1466 //
1467 // Since both spaces must fall within the compressed class pointer encoding
1468 // range, they are allocated close to each other.
|