src/share/vm/gc_implementation/shared/mutableSpace.cpp

Print this page
rev 6521 : 8044775: Improve usage of umbrella header atomic.inline.hpp.


  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "utilities/macros.hpp"
  27 #if INCLUDE_ALL_GCS
  28 #include "gc_implementation/shared/mutableSpace.hpp"
  29 #include "gc_implementation/shared/spaceDecorator.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "runtime/safepoint.hpp"
  32 #include "runtime/thread.hpp"
  33 #endif // INCLUDE_ALL_GCS

  34 
  35 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  36 
  37 MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
  38   assert(MutableSpace::alignment() >= 0 &&
  39          MutableSpace::alignment() % os::vm_page_size() == 0,
  40          "Space should be aligned");
  41   _mangler = new MutableSpaceMangler(this);
  42 }
  43 
  44 MutableSpace::~MutableSpace() {
  45   delete _mangler;
  46 }
  47 
  48 void MutableSpace::numa_setup_pages(MemRegion mr, bool clear_space) {
  49   if (!mr.is_empty()) {
  50     size_t page_size = UseLargePages ? alignment() : os::vm_page_size();
  51     HeapWord *start = (HeapWord*)round_to((intptr_t) mr.start(), page_size);
  52     HeapWord *end =  (HeapWord*)round_down((intptr_t) mr.end(), page_size);
  53     if (end > start) {




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "utilities/macros.hpp"
  27 #if INCLUDE_ALL_GCS
  28 #include "gc_implementation/shared/mutableSpace.hpp"
  29 #include "gc_implementation/shared/spaceDecorator.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "runtime/safepoint.hpp"
  32 #include "runtime/thread.hpp"
  33 #endif // INCLUDE_ALL_GCS
  34 #include "runtime/atomic.inline.hpp"
  35 
  36 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  37 
  38 MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
  39   assert(MutableSpace::alignment() >= 0 &&
  40          MutableSpace::alignment() % os::vm_page_size() == 0,
  41          "Space should be aligned");
  42   _mangler = new MutableSpaceMangler(this);
  43 }
  44 
  45 MutableSpace::~MutableSpace() {
  46   delete _mangler;
  47 }
  48 
  49 void MutableSpace::numa_setup_pages(MemRegion mr, bool clear_space) {
  50   if (!mr.is_empty()) {
  51     size_t page_size = UseLargePages ? alignment() : os::vm_page_size();
  52     HeapWord *start = (HeapWord*)round_to((intptr_t) mr.start(), page_size);
  53     HeapWord *end =  (HeapWord*)round_down((intptr_t) mr.end(), page_size);
  54     if (end > start) {