equal
deleted
inserted
replaced
26 #include "classfile/systemDictionary.hpp" |
26 #include "classfile/systemDictionary.hpp" |
27 #include "classfile/vmSymbols.hpp" |
27 #include "classfile/vmSymbols.hpp" |
28 #include "gc_implementation/shared/liveRange.hpp" |
28 #include "gc_implementation/shared/liveRange.hpp" |
29 #include "gc_implementation/shared/markSweep.hpp" |
29 #include "gc_implementation/shared/markSweep.hpp" |
30 #include "gc_implementation/shared/spaceDecorator.hpp" |
30 #include "gc_implementation/shared/spaceDecorator.hpp" |
|
31 #include "gc_interface/collectedHeap.inline.hpp" |
31 #include "memory/blockOffsetTable.inline.hpp" |
32 #include "memory/blockOffsetTable.inline.hpp" |
32 #include "memory/defNewGeneration.hpp" |
33 #include "memory/defNewGeneration.hpp" |
33 #include "memory/genCollectedHeap.hpp" |
34 #include "memory/genCollectedHeap.hpp" |
34 #include "memory/space.hpp" |
35 #include "memory/space.hpp" |
35 #include "memory/space.inline.hpp" |
36 #include "memory/space.inline.hpp" |
716 } |
717 } |
717 } else { |
718 } else { |
718 return NULL; |
719 return NULL; |
719 } |
720 } |
720 } while (true); |
721 } while (true); |
|
722 } |
|
723 |
|
724 HeapWord* ContiguousSpace::allocate_aligned(size_t size) { |
|
725 assert(Heap_lock->owned_by_self() || (SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread()), "not locked"); |
|
726 HeapWord* end_value = end(); |
|
727 |
|
728 HeapWord* obj = CollectedHeap::align_allocation_or_fail(top(), end_value, SurvivorAlignmentInBytes); |
|
729 if (obj == NULL) { |
|
730 return NULL; |
|
731 } |
|
732 |
|
733 if (pointer_delta(end_value, obj) >= size) { |
|
734 HeapWord* new_top = obj + size; |
|
735 set_top(new_top); |
|
736 assert(is_ptr_aligned(obj, SurvivorAlignmentInBytes) && is_aligned(new_top), |
|
737 "checking alignment"); |
|
738 return obj; |
|
739 } else { |
|
740 set_top(obj); |
|
741 return NULL; |
|
742 } |
721 } |
743 } |
722 |
744 |
723 // Requires locking. |
745 // Requires locking. |
724 HeapWord* ContiguousSpace::allocate(size_t size) { |
746 HeapWord* ContiguousSpace::allocate(size_t size) { |
725 return allocate_impl(size, end()); |
747 return allocate_impl(size, end()); |