411 top(), next_aligned);
412 allocate_padding_chunks_until_top_is_at(next_aligned);
413 // Now, top should be aligned correctly.
414 assert_is_aligned(top(), required_chunk_alignment);
415 }
416
417 // Now, top should be aligned correctly.
418 assert_is_aligned(top(), required_chunk_alignment);
419
420 // Bottom of the new chunk
421 MetaWord* chunk_limit = top();
422 assert(chunk_limit != NULL, "Not safe to call this method");
423
424 // The virtual spaces are always expanded by the
425 // commit granularity to enforce the following condition.
426 // Without this the is_available check will not work correctly.
427 assert(_virtual_space.committed_size() == _virtual_space.actual_committed_size(),
428 "The committed memory doesn't match the expanded memory.");
429
430 if (!is_available(chunk_word_size)) {
431 LogTarget(Debug, gc, metaspace, freelist) lt;
432 if (lt.is_enabled()) {
433 LogStream ls(lt);
434 ls.print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size);
435 // Dump some information about the virtual space that is nearly full
436 print_on(&ls);
437 }
438 return NULL;
439 }
440
441 // Take the space (bump top on the current virtual space).
442 inc_top(chunk_word_size);
443
444 // Initialize the chunk
445 ChunkIndex chunk_type = get_chunk_type_by_size(chunk_word_size, is_class());
446 Metachunk* result = ::new (chunk_limit) Metachunk(chunk_type, is_class(), chunk_word_size, this);
447 assert(result == (Metachunk*)chunk_limit, "Sanity");
448 occupancy_map()->set_chunk_starts_at_address((MetaWord*)result, true);
449 do_update_in_use_info_for_chunk(result, true);
450
451 inc_container_count();
|
411 top(), next_aligned);
412 allocate_padding_chunks_until_top_is_at(next_aligned);
413 // Now, top should be aligned correctly.
414 assert_is_aligned(top(), required_chunk_alignment);
415 }
416
417 // Now, top should be aligned correctly.
418 assert_is_aligned(top(), required_chunk_alignment);
419
420 // Bottom of the new chunk
421 MetaWord* chunk_limit = top();
422 assert(chunk_limit != NULL, "Not safe to call this method");
423
424 // The virtual spaces are always expanded by the
425 // commit granularity to enforce the following condition.
426 // Without this the is_available check will not work correctly.
427 assert(_virtual_space.committed_size() == _virtual_space.actual_committed_size(),
428 "The committed memory doesn't match the expanded memory.");
429
430 if (!is_available(chunk_word_size)) {
431 LogTarget(Trace, gc, metaspace, freelist) lt;
432 if (lt.is_enabled()) {
433 LogStream ls(lt);
434 ls.print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size);
435 // Dump some information about the virtual space that is nearly full
436 print_on(&ls);
437 }
438 return NULL;
439 }
440
441 // Take the space (bump top on the current virtual space).
442 inc_top(chunk_word_size);
443
444 // Initialize the chunk
445 ChunkIndex chunk_type = get_chunk_type_by_size(chunk_word_size, is_class());
446 Metachunk* result = ::new (chunk_limit) Metachunk(chunk_type, is_class(), chunk_word_size, this);
447 assert(result == (Metachunk*)chunk_limit, "Sanity");
448 occupancy_map()->set_chunk_starts_at_address((MetaWord*)result, true);
449 do_update_in_use_info_for_chunk(result, true);
450
451 inc_container_count();
|