diff -r 13588c901957 -r 9cf78a70fa4f src/hotspot/share/memory/universe.cpp --- a/src/hotspot/share/memory/universe.cpp Thu Oct 17 20:27:44 2019 +0100 +++ b/src/hotspot/share/memory/universe.cpp Thu Oct 17 20:53:35 2019 +0100 @@ -571,13 +571,13 @@ // preallocated errors with backtrace have been consumed. Also need to avoid // a potential loop which could happen if an out of memory occurs when attempting // to allocate the backtrace. - return ((!oopDesc::equals(throwable(), Universe::_out_of_memory_error_java_heap)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_metaspace)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_class_metaspace)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_array_size)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_gc_overhead_limit)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_realloc_objects)) && - (!oopDesc::equals(throwable(), Universe::_out_of_memory_error_retry))); + return ((throwable() != Universe::_out_of_memory_error_java_heap) && + (throwable() != Universe::_out_of_memory_error_metaspace) && + (throwable() != Universe::_out_of_memory_error_class_metaspace) && + (throwable() != Universe::_out_of_memory_error_array_size) && + (throwable() != Universe::_out_of_memory_error_gc_overhead_limit) && + (throwable() != Universe::_out_of_memory_error_realloc_objects) && + (throwable() != Universe::_out_of_memory_error_retry)); } @@ -666,12 +666,8 @@ return status; } - CompressedOops::initialize(); - Universe::initialize_tlab(); - SystemDictionary::initialize_oop_storage(); - Metaspace::global_initialize(); // Initialize performance counters for metaspaces @@ -714,7 +710,7 @@ } #if INCLUDE_CDS - if (DumpSharedSpaces || DynamicDumpSharedSpaces) { + if (Arguments::is_dumping_archive()) { MetaspaceShared::prepare_for_dumping(); } #endif @@ -749,7 +745,7 @@ } } -ReservedSpace Universe::reserve_heap(size_t heap_size, size_t alignment) { +ReservedHeapSpace Universe::reserve_heap(size_t heap_size, size_t alignment) { assert(alignment <= Arguments::conservative_max_heap_alignment(), "actual alignment " SIZE_FORMAT " must be within maximum heap alignment " SIZE_FORMAT, @@ -772,16 +768,16 @@ "must be exactly of required size and alignment"); // We are good. - if (UseCompressedOops) { - // Universe::initialize_heap() will reset this to NULL if unscaled - // or zero-based narrow oops are actually used. - // Else heap start and base MUST differ, so that NULL can be encoded nonambigous. - CompressedOops::set_base((address)total_rs.compressed_oop_base()); - } - if (AllocateHeapAt != NULL) { log_info(gc,heap)("Successfully allocated Java heap at location %s", AllocateHeapAt); } + + if (UseCompressedOops) { + CompressedOops::initialize(total_rs); + } + + Universe::calculate_verify_data((HeapWord*)total_rs.base(), (HeapWord*)total_rs.end()); + return total_rs; } @@ -1173,24 +1169,20 @@ // Oop verification (see MacroAssembler::verify_oop) uintptr_t Universe::verify_oop_mask() { - MemRegion m = heap()->reserved_region(); - calculate_verify_data(m.start(), m.end()); return _verify_oop_mask; } uintptr_t Universe::verify_oop_bits() { - MemRegion m = heap()->reserved_region(); - calculate_verify_data(m.start(), m.end()); return _verify_oop_bits; } uintptr_t Universe::verify_mark_mask() { - return markOopDesc::lock_mask_in_place; + return markWord::lock_mask_in_place; } uintptr_t Universe::verify_mark_bits() { intptr_t mask = verify_mark_mask(); - intptr_t bits = (intptr_t)markOopDesc::prototype(); + intptr_t bits = (intptr_t)markWord::prototype().value(); assert((bits & ~mask) == 0, "no stray header bits"); return bits; }