196 assert(is_aligned(reserved_low_addr()), "bad reserved_low_addr"); 197 assert(is_aligned(reserved_high_addr()), "bad reserved_high_addr"); 198 assert(is_aligned(committed_low_addr()), "bad committed_low_addr"); 199 assert(is_aligned(committed_high_addr()), "bad committed_high_addr"); 200 201 // Reserved region must be non-empty or both addrs must be 0. 202 assert(reserved_low_addr() < reserved_high_addr() || 203 reserved_low_addr() == NULL && reserved_high_addr() == NULL, 204 "bad reserved addrs"); 205 assert(committed_low_addr() <= committed_high_addr(), "bad committed addrs"); 206 207 if (grows_up()) { 208 assert(reserved_low_addr() == committed_low_addr(), "bad low addrs"); 209 assert(reserved_high_addr() >= committed_high_addr(), "bad high addrs"); 210 } else { 211 assert(reserved_high_addr() == committed_high_addr(), "bad high addrs"); 212 assert(reserved_low_addr() <= committed_low_addr(), "bad low addrs"); 213 } 214 } 215 216 void PSVirtualSpace::print() const { 217 gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]: alignment=" 218 SIZE_FORMAT "K grows %s%s", 219 p2i(this), alignment() / K, grows_up() ? "up" : "down", 220 special() ? " (pinned in memory)" : ""); 221 gclog_or_tty->print_cr(" reserved=" SIZE_FORMAT "K" 222 " [" PTR_FORMAT "," PTR_FORMAT "]" 223 " committed=" SIZE_FORMAT "K" 224 " [" PTR_FORMAT "," PTR_FORMAT "]", 225 reserved_size() / K, 226 p2i(reserved_low_addr()), p2i(reserved_high_addr()), 227 committed_size() / K, 228 p2i(committed_low_addr()), p2i(committed_high_addr())); 229 } 230 #endif // #ifndef PRODUCT 231 232 void PSVirtualSpace::print_space_boundaries_on(outputStream* st) const { 233 st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", 234 p2i(low_boundary()), p2i(high()), p2i(high_boundary())); 235 } 236 237 PSVirtualSpaceHighToLow::PSVirtualSpaceHighToLow(ReservedSpace rs, 238 size_t alignment) : 239 PSVirtualSpace(alignment) 240 { 241 set_reserved(rs); 242 set_committed(reserved_high_addr(), reserved_high_addr()); 243 DEBUG_ONLY(verify()); 244 } 245 246 PSVirtualSpaceHighToLow::PSVirtualSpaceHighToLow(ReservedSpace rs) { 247 set_reserved(rs); 248 set_committed(reserved_high_addr(), reserved_high_addr()); 249 DEBUG_ONLY(verify()); | 196 assert(is_aligned(reserved_low_addr()), "bad reserved_low_addr"); 197 assert(is_aligned(reserved_high_addr()), "bad reserved_high_addr"); 198 assert(is_aligned(committed_low_addr()), "bad committed_low_addr"); 199 assert(is_aligned(committed_high_addr()), "bad committed_high_addr"); 200 201 // Reserved region must be non-empty or both addrs must be 0. 202 assert(reserved_low_addr() < reserved_high_addr() || 203 reserved_low_addr() == NULL && reserved_high_addr() == NULL, 204 "bad reserved addrs"); 205 assert(committed_low_addr() <= committed_high_addr(), "bad committed addrs"); 206 207 if (grows_up()) { 208 assert(reserved_low_addr() == committed_low_addr(), "bad low addrs"); 209 assert(reserved_high_addr() >= committed_high_addr(), "bad high addrs"); 210 } else { 211 assert(reserved_high_addr() == committed_high_addr(), "bad high addrs"); 212 assert(reserved_low_addr() <= committed_low_addr(), "bad low addrs"); 213 } 214 } 215 216 #endif // #ifndef PRODUCT 217 218 void PSVirtualSpace::print_space_boundaries_on(outputStream* st) const { 219 st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", 220 p2i(low_boundary()), p2i(high()), p2i(high_boundary())); 221 } 222 223 PSVirtualSpaceHighToLow::PSVirtualSpaceHighToLow(ReservedSpace rs, 224 size_t alignment) : 225 PSVirtualSpace(alignment) 226 { 227 set_reserved(rs); 228 set_committed(reserved_high_addr(), reserved_high_addr()); 229 DEBUG_ONLY(verify()); 230 } 231 232 PSVirtualSpaceHighToLow::PSVirtualSpaceHighToLow(ReservedSpace rs) { 233 set_reserved(rs); 234 set_committed(reserved_high_addr(), reserved_high_addr()); 235 DEBUG_ONLY(verify()); |