648 _lower_alignment = os::vm_page_size(); |
648 _lower_alignment = os::vm_page_size(); |
649 _middle_alignment = max_commit_granularity; |
649 _middle_alignment = max_commit_granularity; |
650 _upper_alignment = os::vm_page_size(); |
650 _upper_alignment = os::vm_page_size(); |
651 |
651 |
652 // End of each region |
652 // End of each region |
653 _lower_high_boundary = (char*) round_to((intptr_t) low_boundary(), middle_alignment()); |
653 _lower_high_boundary = align_up(low_boundary(), middle_alignment()); |
654 _middle_high_boundary = (char*) round_down((intptr_t) high_boundary(), middle_alignment()); |
654 _middle_high_boundary = align_down(high_boundary(), middle_alignment()); |
655 _upper_high_boundary = high_boundary(); |
655 _upper_high_boundary = high_boundary(); |
656 |
656 |
657 // High address of each region |
657 // High address of each region |
658 _lower_high = low_boundary(); |
658 _lower_high = low_boundary(); |
659 _middle_high = lower_high_boundary(); |
659 _middle_high = lower_high_boundary(); |
810 |
810 |
811 // Align the new highs based on the regions alignment. lower and upper |
811 // Align the new highs based on the regions alignment. lower and upper |
812 // alignment will always be default page size. middle alignment will be |
812 // alignment will always be default page size. middle alignment will be |
813 // LargePageSizeInBytes if the actual size of the virtual space is in |
813 // LargePageSizeInBytes if the actual size of the virtual space is in |
814 // fact larger than LargePageSizeInBytes. |
814 // fact larger than LargePageSizeInBytes. |
815 char* aligned_lower_new_high = (char*) round_to((intptr_t) unaligned_lower_new_high, lower_alignment()); |
815 char* aligned_lower_new_high = align_up(unaligned_lower_new_high, lower_alignment()); |
816 char* aligned_middle_new_high = (char*) round_to((intptr_t) unaligned_middle_new_high, middle_alignment()); |
816 char* aligned_middle_new_high = align_up(unaligned_middle_new_high, middle_alignment()); |
817 char* aligned_upper_new_high = (char*) round_to((intptr_t) unaligned_upper_new_high, upper_alignment()); |
817 char* aligned_upper_new_high = align_up(unaligned_upper_new_high, upper_alignment()); |
818 |
818 |
819 // Determine which regions need to grow in this expand_by call. |
819 // Determine which regions need to grow in this expand_by call. |
820 // If you are growing in the lower region, high() must be in that |
820 // If you are growing in the lower region, high() must be in that |
821 // region so calculate the size based on high(). For the middle and |
821 // region so calculate the size based on high(). For the middle and |
822 // upper regions, determine the starting point of growth based on the |
822 // upper regions, determine the starting point of growth based on the |
896 MAX2(unaligned_new_high, lower_high_boundary()); |
896 MAX2(unaligned_new_high, lower_high_boundary()); |
897 char* unaligned_lower_new_high = |
897 char* unaligned_lower_new_high = |
898 MAX2(unaligned_new_high, low_boundary()); |
898 MAX2(unaligned_new_high, low_boundary()); |
899 |
899 |
900 // Align address to region's alignment |
900 // Align address to region's alignment |
901 char* aligned_upper_new_high = |
901 char* aligned_upper_new_high = align_up(unaligned_upper_new_high, upper_alignment()); |
902 (char*) round_to((intptr_t) unaligned_upper_new_high, upper_alignment()); |
902 char* aligned_middle_new_high = align_up(unaligned_middle_new_high, middle_alignment()); |
903 char* aligned_middle_new_high = |
903 char* aligned_lower_new_high = align_up(unaligned_lower_new_high, lower_alignment()); |
904 (char*) round_to((intptr_t) unaligned_middle_new_high, middle_alignment()); |
|
905 char* aligned_lower_new_high = |
|
906 (char*) round_to((intptr_t) unaligned_lower_new_high, lower_alignment()); |
|
907 |
904 |
908 // Determine which regions need to shrink |
905 // Determine which regions need to shrink |
909 size_t upper_needs = 0; |
906 size_t upper_needs = 0; |
910 if (aligned_upper_new_high < upper_high()) { |
907 if (aligned_upper_new_high < upper_high()) { |
911 upper_needs = |
908 upper_needs = |