2931 assert_is_size_aligned(compressed_class_space_size(), _reserve_alignment); |
2931 assert_is_size_aligned(compressed_class_space_size(), _reserve_alignment); |
2932 |
2932 |
2933 // Don't use large pages for the class space. |
2933 // Don't use large pages for the class space. |
2934 bool large_pages = false; |
2934 bool large_pages = false; |
2935 |
2935 |
2936 #ifndef AARCH64 |
2936 #if !(defined(AARCH64) || defined(AIX)) |
2937 ReservedSpace metaspace_rs = ReservedSpace(compressed_class_space_size(), |
2937 ReservedSpace metaspace_rs = ReservedSpace(compressed_class_space_size(), |
2938 _reserve_alignment, |
2938 _reserve_alignment, |
2939 large_pages, |
2939 large_pages, |
2940 requested_addr); |
2940 requested_addr); |
2941 #else // AARCH64 |
2941 #else // AARCH64 |
2943 |
2943 |
2944 // Our compressed klass pointers may fit nicely into the lower 32 |
2944 // Our compressed klass pointers may fit nicely into the lower 32 |
2945 // bits. |
2945 // bits. |
2946 if ((uint64_t)requested_addr + compressed_class_space_size() < 4*G) { |
2946 if ((uint64_t)requested_addr + compressed_class_space_size() < 4*G) { |
2947 metaspace_rs = ReservedSpace(compressed_class_space_size(), |
2947 metaspace_rs = ReservedSpace(compressed_class_space_size(), |
2948 _reserve_alignment, |
2948 _reserve_alignment, |
2949 large_pages, |
2949 large_pages, |
2950 requested_addr); |
2950 requested_addr); |
2951 } |
2951 } |
2952 |
2952 |
2953 if (! metaspace_rs.is_reserved()) { |
2953 if (! metaspace_rs.is_reserved()) { |
2954 // Try to align metaspace so that we can decode a compressed klass |
2954 // Aarch64: Try to align metaspace so that we can decode a compressed |
2955 // with a single MOVK instruction. We can do this iff the |
2955 // klass with a single MOVK instruction. We can do this iff the |
2956 // compressed class base is a multiple of 4G. |
2956 // compressed class base is a multiple of 4G. |
2957 for (char *a = (char*)align_ptr_up(requested_addr, 4*G); |
2957 // Aix: Search for a place where we can find memory. If we need to load |
|
2958 // the base, 4G alignment is helpful, too. |
|
2959 size_t increment = AARCH64_ONLY(4*)G; |
|
2960 for (char *a = (char*)align_ptr_up(requested_addr, increment); |
2958 a < (char*)(1024*G); |
2961 a < (char*)(1024*G); |
2959 a += 4*G) { |
2962 a += increment) { |
|
2963 if (a == (char *)(32*G)) { |
|
2964 // Go faster from here on. Zero-based is no longer possible. |
|
2965 increment = 4*G; |
|
2966 } |
2960 |
2967 |
2961 #if INCLUDE_CDS |
2968 #if INCLUDE_CDS |
2962 if (UseSharedSpaces |
2969 if (UseSharedSpaces |
2963 && ! can_use_cds_with_metaspace_addr(a, cds_base)) { |
2970 && ! can_use_cds_with_metaspace_addr(a, cds_base)) { |
2964 // We failed to find an aligned base that will reach. Fall |
2971 // We failed to find an aligned base that will reach. Fall |