25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "logging/log.hpp" |
26 #include "logging/log.hpp" |
27 #include "memory/resourceArea.hpp" |
27 #include "memory/resourceArea.hpp" |
28 #include "memory/virtualspace.hpp" |
28 #include "memory/virtualspace.hpp" |
29 #include "oops/compressedOops.hpp" |
29 #include "oops/compressedOops.hpp" |
30 #include "oops/markOop.hpp" |
30 #include "oops/markWord.hpp" |
31 #include "oops/oop.inline.hpp" |
31 #include "oops/oop.inline.hpp" |
32 #include "runtime/os.inline.hpp" |
32 #include "runtime/os.inline.hpp" |
33 #include "services/memTracker.hpp" |
33 #include "services/memTracker.hpp" |
34 #include "utilities/align.hpp" |
34 #include "utilities/align.hpp" |
35 |
35 |
621 } |
621 } |
622 } else { |
622 } else { |
623 initialize(size, alignment, large, NULL, false); |
623 initialize(size, alignment, large, NULL, false); |
624 } |
624 } |
625 |
625 |
626 assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base, |
626 assert(markWord::encode_pointer_as_mark(_base).decode_pointer() == _base, |
627 "area must be distinguishable from marks for mark-sweep"); |
627 "area must be distinguishable from marks for mark-sweep"); |
628 assert(markOopDesc::encode_pointer_as_mark(&_base[size])->decode_pointer() == &_base[size], |
628 assert(markWord::encode_pointer_as_mark(&_base[size]).decode_pointer() == &_base[size], |
629 "area must be distinguishable from marks for mark-sweep"); |
629 "area must be distinguishable from marks for mark-sweep"); |
630 |
630 |
631 if (base() != NULL) { |
631 if (base() != NULL) { |
632 MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap); |
632 MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap); |
633 } |
633 } |
634 |
634 |
635 if (_fd_for_heap != -1) { |
635 if (_fd_for_heap != -1) { |
636 os::close(_fd_for_heap); |
636 os::close(_fd_for_heap); |
637 } |
637 } |
|
638 } |
|
639 |
|
640 MemRegion ReservedHeapSpace::region() const { |
|
641 return MemRegion((HeapWord*)base(), (HeapWord*)end()); |
638 } |
642 } |
639 |
643 |
640 // Reserve space for code segment. Same as Java heap only we mark this as |
644 // Reserve space for code segment. Same as Java heap only we mark this as |
641 // executable. |
645 // executable. |
642 ReservedCodeSpace::ReservedCodeSpace(size_t r_size, |
646 ReservedCodeSpace::ReservedCodeSpace(size_t r_size, |