781 // Remove OopStorage roots
782 if (_objects_are_handles) {
783 size_t num_handles = _num_archived_objects;
784 // Skip the null entry
785 oop** handles = ((oop**)_object_index_to_heap_object_table) + 1;
786 // Sort the handles so that oop storage can release them faster
787 qsort(handles, num_handles, sizeof(oop*), (int (*)(const void*, const void*))oop_handle_cmp);
788 size_t num_null_handles = 0;
789 for (size_t handles_remaining = num_handles; handles_remaining != 0; --handles_remaining) {
790 oop* handle = handles[handles_remaining - 1];
791 if (handle == nullptr) {
792 num_null_handles = handles_remaining;
793 break;
794 }
795 NativeAccess<>::oop_store(handle, nullptr);
796 }
797 Universe::vm_global()->release(&handles[num_null_handles], num_handles - num_null_handles);
798 }
799
800 FREE_C_HEAP_ARRAY(void*, _object_index_to_heap_object_table);
801
802 // Unmap regions
803 FileMapInfo::current_info()->unmap_region(AOTMetaspace::hp);
804 FileMapInfo::current_info()->unmap_region(AOTMetaspace::bm);
805
806 _cleanup_materialization_time_ns = (Ticks::now() - start).nanoseconds();
807
808 log_statistics();
809 }
810
811 void AOTStreamedHeapLoader::log_statistics() {
812 uint64_t total_duration_us = (Ticks::now() - _materialization_start_ticks).microseconds();
813 const bool is_async = _loading_all_objects && !AOTEagerlyLoadObjects;
814 const char* const async_or_sync = is_async ? "async" : "sync";
815 log_info(aot, heap)("start to finish materialization time: " UINT64_FORMAT "us",
816 total_duration_us);
817 log_info(aot, heap)("early object materialization time (%s): " UINT64_FORMAT "us",
818 async_or_sync, _early_materialization_time_ns / 1000);
819 log_info(aot, heap)("late object materialization time (%s): " UINT64_FORMAT "us",
820 async_or_sync, _late_materialization_time_ns / 1000);
|
781 // Remove OopStorage roots
782 if (_objects_are_handles) {
783 size_t num_handles = _num_archived_objects;
784 // Skip the null entry
785 oop** handles = ((oop**)_object_index_to_heap_object_table) + 1;
786 // Sort the handles so that oop storage can release them faster
787 qsort(handles, num_handles, sizeof(oop*), (int (*)(const void*, const void*))oop_handle_cmp);
788 size_t num_null_handles = 0;
789 for (size_t handles_remaining = num_handles; handles_remaining != 0; --handles_remaining) {
790 oop* handle = handles[handles_remaining - 1];
791 if (handle == nullptr) {
792 num_null_handles = handles_remaining;
793 break;
794 }
795 NativeAccess<>::oop_store(handle, nullptr);
796 }
797 Universe::vm_global()->release(&handles[num_null_handles], num_handles - num_null_handles);
798 }
799
800 FREE_C_HEAP_ARRAY(void*, _object_index_to_heap_object_table);
801 _object_index_to_heap_object_table = nullptr;
802 _roots_archive = nullptr;
803
804 // Unmap regions
805 FileMapInfo::current_info()->unmap_region(AOTMetaspace::hp);
806 FileMapInfo::current_info()->unmap_region(AOTMetaspace::bm);
807
808 _cleanup_materialization_time_ns = (Ticks::now() - start).nanoseconds();
809
810 log_statistics();
811 }
812
813 void AOTStreamedHeapLoader::log_statistics() {
814 uint64_t total_duration_us = (Ticks::now() - _materialization_start_ticks).microseconds();
815 const bool is_async = _loading_all_objects && !AOTEagerlyLoadObjects;
816 const char* const async_or_sync = is_async ? "async" : "sync";
817 log_info(aot, heap)("start to finish materialization time: " UINT64_FORMAT "us",
818 total_duration_us);
819 log_info(aot, heap)("early object materialization time (%s): " UINT64_FORMAT "us",
820 async_or_sync, _early_materialization_time_ns / 1000);
821 log_info(aot, heap)("late object materialization time (%s): " UINT64_FORMAT "us",
822 async_or_sync, _late_materialization_time_ns / 1000);
|